Perhaps worth noting that the version of Firebird.pas distributed with IBX for Lazarus is patched with many changes. See

https://svn.mwasoftware.co.uk/viewvc/public/ibx/trunk/fbintf/client/3.0/firebird/Firebird.pas?revision=209&view=markup

This is:

1. To comment out all exception handling. This is to allow the IBX code to check for and handle the exceptions itself. In some cases, it allows for the exception to be returned as an error code rather than as an exception. This avoids the library user complaining that there is a bug in IBX when the exception appears in the IDE - this is in cases where IBX automatically handles the error code returned and does so otherwise silently.

2. For Unit structure reasons.  Many of the Firebird constants are commented out and moved to a separate include file - actually restoring the original 'C' header file structure. This allows them to be referenced from the user interface without having to include the "firebird.pas" unit. This is particularly useful in allowing for a common interface for both the Firebird 3 API and the legacy API.

It also avoids type name clashes. There are common type names (for different types) between IBX and the Firebird.pas unit (e.g. IStatement). Firebird.pas also does not follow type naming conventions for Delphi/FPC. IStatement should be an interface type, while it is a class in firebird.pas. In IBX, IStatement is the type name in IBX for a Pascal Interface to an SQL Statement.

Whenever a Firebird.pas type is used in IBX, it is always scoped by prefixing it with "firebird." and the name of the "firebird" unit is carefully placed in the correct order in the calling unit's "uses" clause. This avoids any type name clashes within the IBX library itself,

If IBX users had to do the same thing then novice users would find IBX difficult to use because of type name clashes. Hence, the need to avoid IBX users from having to include the "firebird.pas" unit in any of their unit's "uses" clauses.

3. The type name ISC_QUAD_Ptr is replaced with PISC_QUAD. This is again for compatibility reasons with the legacy API interface.


On 03/05/18 08:29, Alex Peshkoff via Firebird-devel wrote:
On 04/30/18 11:20, Mark Rotteveel wrote:
On 30-4-2018 09:52, fbbt wrote:
3. Maybe we need to put a sample of firebird.pas at github. It will allow other developers to patch it in more productive way than now.

As I understand it, firebird.pas is generated by Cloop, so allowing people to patch it would be against the intent. The problem would need to be fixed in the code generator: https://github.com/asfernandes/cloop (if I'm not mistaken, maybe Adriano can better address this).


Useful suggestions (including patches) from other developers are anyway welcome - quite possible that some of them can be added to cloop.


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
Firebird-Devel mailing list, web interface at https://lists.sourceforge.net/lists/listinfo/firebird-devel



------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel

Reply via email to