Giter Site home page Giter Site logo

Delphi API ? about kernel-bridge HOT 5 CLOSED

hoshimin avatar hoshimin commented on August 25, 2024
Delphi API ?

from kernel-bridge.

Comments (5)

chmichael avatar chmichael commented on August 25, 2024 1

Delphi Connector: https://github.com/diversenok/Kernel-Bridge-Delphi-Connector

from kernel-bridge.

HoShiMin avatar HoShiMin commented on August 25, 2024

Not yet, but who knows...
Anyway, you can write it yourself and send me a pull request

from kernel-bridge.

marcussacana avatar marcussacana commented on August 25, 2024

I already wanted create one to C# before, well, I stopped when I saw a little complex struct (EPocess if i'm not wrong, there are some bitfields and the C# don't support it), you see, I don't know much of C++, then I had a doubt about the bitfield,
If the struct have a 3 bitfields, this mean we have 5 bits left, but the next field isn't a bit value, but a integer, then what happen now? the interger will begin from this 5 bits left or the reaming bits of the byte will be skipped and then the field will begin in the begin of the next byte?
I think after came with this doubt I think, "nahh forget this shit" and I stopped.

from kernel-bridge.

HoShiMin avatar HoShiMin commented on August 25, 2024

@marcussacana
Well, if you want to implement bitfields without support in language (like in C#), you can use bit masks (just AND'ing or OR'ing the value with the mask):

int value = 0x123;
int mask = 4; // 0b100 (bits counting started with 0)

// Is bit set:
bool is2ndBitSet = (value & mask) == mask;

// Set the bit:
value |= mask;

// Reset the bit:
value &= ~mask;

You can use this stuff if you need it.
What about bitfields in C++:

union S
{
    unsigned long long val; // 8 bytes
    struct
    {
        unsiged int a : 1; // Zero bit
        unsigned int b : 1; // First bit
        unsigned int c : 2; // Second and third bits
        unsigned int d; // 32 bits value starting with 32'nd bit [32..63]! All bits [4..31] are 'invisible' here
    } bitmap;
};

And what about pull requests - I accept them if they're well-coded and convenient, but without any special requirements.
So, you're welcome! 😉

from kernel-bridge.

marcussacana avatar marcussacana commented on August 25, 2024

I see, haha, don't care, i'm not newbie enough to don't know bitwise operations, it's just that problem with the bitfield in the struct... well maybe I can give a try a day, thx for the information.

from kernel-bridge.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.