Jump to content

Leaderboard


Popular Content

Showing content with the highest reputation on 03/07/22 in all areas

  1. tinyBigGAMES

    CPas - C for Delphi

    Overview What if you were able to load and use C99 sources directly from Delphi? There is a vast quantity of C libraries out there and being able to take advantage of them, without being a pain would be nice. You could even compile a bunch of sources and save them as a library file, then load them back in from disk, a resource or even from a stream. You can get the symbols, map to a C routine, and execute from the Delphi side all from a simple API. Downloads Releases - These are the official release versions. Features Free for commercial use. Allow C integration with Delphi at run-time. Support Windows 64-bit platform. Support for C99. Fast run-time compilation. Can run C sources directly or compile to (.LIB, .EXE, .DLL). Library files can be loaded and used at run-time from a file, a resource or stream. Import symbols directly from a dynamic linked library (.DLL) or module-definition (.DEF) file. You can reference the symbols from Delphi and directly access their value (mapping to a routine and data). Your application can dynamically or statically link to CPas. Direct access to the vast quantity of C99 libraries inside Delphi. Minimum System Requirements Delphi 10 (Win64 target only) FreePascal 3.3.3 (Win64 target only) Microsoft Windows 10, 64-bits 20MB of free hard drive space How to use in Delphi Unzip the archive to a desired location. Add installdir\sources, folder to Delphi's library path so the CPas source files can be found for any project or for a specific project add to its search path. Add installdir\bin, folder to Windows path so that CPas.dll file can be found for any project or place beside project executable. See examples in installdir\examples for more information about usage. You must include CPas.dll in your project distribution when dynamically linked to CPas. See CPAS_STATIC define in the CPas unit file. See installdir\docs for documentation. A Tour of CPas CPas API You access the easy to use API in Delphi from the CPas unit. {.$DEFINE CPAS_STATIC} //<-- define for static distribution type { TCPas } TCPas = type Pointer; { TCPasOutput } TCPasOutput = (cpMemory, cpLib); { TCPasExe } TCPasExe = (cpConsole, cpGUI); { TCPasErrorMessageEvent } TCPasErrorEvent = procedure(aSender: Pointer; const aMsg: WideString); { Misc } function cpVersion: WideString; { State management } function cpNew: TCPas; procedure cpFree(var aCPas: TCPas); procedure cpReset(aCPas: TCPas); { Error handling } procedure cpSetErrorHandler(aCPas: TCPas; aSender: Pointer; aHandler: TCPasErrorEvent); procedure cpGetErrorHandler(aCPas: TCPas; var aSender: Pointer; var aHandler: TCPasErrorEvent); { Preprocessing } procedure cpDefineSymbol(aCPas: TCPas; const aName: WideString; const aValue: WideString); procedure cpUndefineSymbol(aCPas: TCPas; const aName: WideString); function cpAddIncludePath(aCPas: TCPas; const aPath: WideString): Boolean; function cpAddLibraryPath(aCPas: TCPas; const aPath: WideString): Boolean; { Compiling } procedure cpSetOuput(aCPas: TCPas; aOutput: TCPasOutput); function cpGetOutput(aCPas: TCPas): TCPasOutput; procedure cpSetExe(aCPas: TCPas; aExe: TCPasExe); function cpGetExe(aCPas: TCPas): TCPasExe; function cpAddLibrary(aCPas: TCPas; const aName: WideString): Boolean; function cpAddFile(aCPas: TCPas; const aFilename: WideString): Boolean; function cpCompileString(aCPas: TCPas; const aBuffer: string): Boolean; procedure cpAddSymbol(aCPas: TCPas; const aName: WideString; aValue: Pointer); function cpLoadLibFromFile(aCPas: TCPas; const aFilename: WideString): Boolean; function cpLoadLibFromResource(aCPas: TCPas; const aResName: WideString): Boolean; function cpLoadLibFromStream(aCPas: TCPas; aStream: TStream): Boolean; function cpSaveOutputFile(aCPas: TCPas; const aFilename: WideString): Boolean; function cpRelocate(aCPas: TCPas): Boolean; function cpRun(aCPas: TCPas): Boolean; function cpGetSymbol(aCPas: TCPas; const aName: WideString): Pointer; { Stats } procedure cpStartStats(aCPas: TCPas); function cpEndStats(aCPas: TCPas; aShow: Boolean): WideString; If you want CPas to be statically bound to your application, enable the {$CPAS_STATIC} define in the CPas unit. How to use A minimal implementation example: uses System.SysUtils, CPas; var c: TCPas; // CPas error handler procedure ErrorHandler(aSender: Pointer; const aMsg: WideString); begin WriteLn(aMsg); end; begin // create a CPas instance c := cpNew; try // setup the error handler cpSetErrorHandler(c, nil, ErrorHandler); // add source file cpAddFile(cp, 'test1.c'); // link and call main cpRun(cp); finally // destroy CPas instance cpFree(c); end; end. Compatibility These are some libraries that I've tested. If you have tried more, let me know and I can add them to the list. miniaudio (https://github.com/mackron/miniaudio) raylib (https://github.com/raysan5/raylib) sfml (https://github.com/SFML/CSFML) stb_image (https://github.com/nothings/stb) stb_image_write (https://github.com/nothings/stb) stb_truetype (https://github.com/nothings/stb) stb_vorbis (https://github.com/nothings/stb) Media ❤ Made in Delphi
  2. Uwe Raabe

    docwiki.embarcadero.com is not working

    Indeed, that seems to be more disturbing than the outage itself.
  3. CyberPeter

    docwiki.embarcadero.com is not working

    It's an absolute disgrace. They really don't care do they ? Plenty of bugs reported already on this issue in https://quality.embarcadero.com (also by me). They tend to get closed as 'resolved' and duplicate. Must be good for the stats. I don't know what's worse, not being able to fix something like this or totally ignoring the community and not communication about it at all.
  4. A.M. Hoornweg

    docwiki.embarcadero.com is not working

    No it is not. Guys, just take a look at the PHP exception trace. More specifically, the line that reads "LoadBalancer->getConnection(0,Array,false)", that's where the shit hits the fan. That line triggers a "connection refused" exception. One of the servers which the load balancer can choose from in this array is inaccessible. Not all of them are inaccessible because when you press F5 often enough in your browser the load balancer will sooner or later hit one that works. So this is a simple web site management issue. The person in charge should simply remove broken db servers from the list which the load balancer uses to choose from. So... Why the heck does Idera not manage this properly?
  5. Anders Melander

    DPROJ changes: SourceTree vs Beyond Compare

    SourceTree is made by Atlassian. Any time you spend reporting bugs to them would better spent picking your nose.
  6. DJof SD

    docwiki.embarcadero.com is not working

    Maybe it'll be fixed after Wednesday. See: https://register.gotowebinar.com/register/7497661470554577420
  7. FPiette

    New install

    Forget about D7! Try with recent Delphi version. Community Edition is free (Commercial use has some restrictions) and good.
  8. Uwe Raabe

    DPROJ changes: SourceTree vs Beyond Compare

    Yes, it does.
  9. Der schöne Günther

    Get memory used by a Memtable record??

    I don't think comparing "memory usage before" and "memory usage after" in a release build is going to yield anything useful. There might be a lot of other things going on in separate threads.
  10. Uwe Raabe

    DPROJ changes: SourceTree vs Beyond Compare

    You can specify a different target path with the -o parameter. I know this option is missing in the help.
  11. Dalija Prasnikar

    docwiki.embarcadero.com is not working

    Issue needs to be reported only once. Adding duplicate reports does not help in solving issue faster. When there is a duplicate report of any issue those are closed as duplicates to enable tracking status in one point not all over the place. This has nothing to do with statistics, this is basic QA workflow. It would be nice to have official statement, but there is not much anyone here can do about it.
  12. Anders Melander

    ANN: Better Translation Manager released

    Uploaded a new build: v1.3.8100.37233. I have finally managed to get upload to BitBucket working so it's available here now: https://bitbucket.org/anders_melander/better-translation-manager/downloads/ Changes since build 1.3.8055.21506: HighDPI scaling has been disabled in order to work around scaling problems caused by the DevExpress skinning engine. When these get resolved I will enable Per Monitor v2 scaling. https://bitbucket.org/anders_melander/better-translation-manager/issues/26/handle-highdpi-scaling @Renate Schaaf Automatically show and focus the multi-line editor if the source text contains multiple lines (optional, enabled by default). https://bitbucket.org/anders_melander/better-translation-manager/issues/15/auto-open-text-editor-when-applicable @aehimself Added a translation integration API which allows the application being translated to control BTM. Using this integration, when a form or control is focused in the application, then the corresponding module and property is selected in BTM. The integration API is contained in the file amLocalization.Integration.Tracker.API.pas Properties that have been omitted from the form resource, for example because their current values equals the default value, can now be synthesized so they can be translated. This solves the problem where for example TField.DisplayLabel could not be translated if DisplayLabel and FieldName contained the same value. A lot of minor bug fixed and improvements. See commit log: https://bitbucket.org/anders_melander/better-translation-manager/commits/
×