cmakeable version of protocol buffers - cross-platform

StackOverflow community!
I want to embed protocol buffers into some project that supports cmake.
As I undrestood, google doesn't provide this
Any suggestions? Who tried to create cmakeable protocol buffers library?
Are there lots of not cross-platform places at the source or there is no at all.
Where can I take it if it exists?
What else cmakeable is there instead of protocol buffers?
Pls, don't ask me why I don't install protocol buffers, and just use compiled libraries,
I need to embed it inside the project.
If it is really bad idea, then, please, explain why.

I created a set of CMakeLists.txt for protobufs for embedding into our build systems, and offered to contribute these to protobufs, but the people at Google weren't interested.
If you'd like, I can provide them "as-is". They work for 2.2.0, but you will probably have to do some hacking on your own to tweak them for your specific build system.

Related

Kotlin/Native Basic Image manipulation

Does Kotlin/Native support any image-processing libraries?
(I'm targeting Windows & Linux)
I failed to find anything on google that doesn't target JVM/Android, but I am new to the Kotlin ecosystem so the answer might be right under my nose.
I'm looking for basic manipulations:
open/save image(jpg, png)
resize
extract crop
If there aren't any, should I try to create bindings for C Image processing library like stb-image or opencv?
There is a korim library, that might help you. Also, there are several places you can find more info on Kotlin/Native libraries, like here and here. The option with C library seems also like a good idea. If you'll got some problems with it, feel free to ask here on in Kotlin Slack (get an invite here).

Import compiled code into C/C++ source code for microcontroller

We'd like to offer a compiled library that implement a protocol layer to be imported into C/C++ source code project for microcontrollers. And eventually expose a sort of compiled function to the source code project. let's say a sort of "dll". Is there any know technique to realize something of similar?
While it is possible to provide functions via a library, generally in the microcontroller/embedded realm it quickly becomes impractical.
Each microcontroller core will have a unique instruction set. Further, micros from the same family may have a variety of extensions which are either supported or not... So you're left with providing a library file for each individual microcontroller (from each vendor) that you'd like to support.
But...
In my experience, calling conventions between compilers are not the same. So a library compiled by one toolchain will not be able to be linked to object files created by another toolchain.
That leads you to then provide a library for each individual micro from each vendor for each toolchain someone might use. Ick. Oh, and don't rely on an OS calls either, as you don't know what you'll be linked with...
A more conventional approach is to use the same approach RTOS vendors tend to use: provide the source, and protect your IP with licensing terms. The reality is that if your end users want to, they can step through the assembly and figure out exactly what is happening, so you're not hiding your implementation that carefully anyway.

How to parse Objective-C code within a Cocoa application

I am writing a Mac OS X desktop application in which I want to be able to parse fragments of Objective-C such as variable and method declarations, as well as full Objective-C header and source files.
It looks to me as if I should be making use of Clang to do this, but I could do with some pointers and examples on how to integrate it as a library in my project, and how to invoke it to parse strings and files.
Can anyone provide me with any help on this?
You probably want libclang, code browsable at http://llvm.org/svn/llvm-project/cfe/trunk/tools/libclang/ (though you'll need to checkout the entire Clang repo to build it). There's very little documentation around on it, sadly. There is a presentation at http://llvm.org/devmtg/2010-11/Gregor-libclang.pdf that might help kickstart things, but mostly just some hunting through the code is the way to go.
Clang is actually more modular than libclang provides for (you can import just the components you want). If you've adventurous, there are examples at http://llvm.org/svn/llvm-project/cfe/trunk/examples/.

what library is better between libcurl and chilkat?

i'm newbie in FTP connection programming in Cocoa. I found 2 library that i can choose for make my app, but i dont know what's the best between these libraries. The libraries are libcurl and chilkat . The problem is what benefit of each library? Did somebody compare it? or maybe can anyone tell me about your experience? Thank you
I don't have any experience with chilkat, but I can tell yout that libcurl is used in a lot of programming languages and is available on a lot of systems. In for example PHP or on a Mac curl is a great tool to use.
So I would advice libcurl if it's available on your platform. You will probably find more information about curl and it has proven itself on many other platforms.
Also interesting if you want to go with curl is curlhandle. It's a cocoa wrapper around the curl library. Probably very handy in your case, but I've no experience with it.
I can tell you that the difference between libcurl and chilkat is like this: (though you probably know by now)
Chilkat is like the chess game you buy at the store and libcurl is like the plastic in liquid form you buy that you can make any chess piece with.
Libcurl is a slightly abstracted sockets-connector and Chilkat handles everything you'd do, up to a certain amount, with that connection. You're either staring at bits or something "made those bits into an email". I'm about to buy Chilkat for some of the libs, I like the features, but at the same time I wish I had time to read the RFC's and play with the other stuff using libcurl. Anywho, hope that answer is worth something to someone.
Because this question is still ranking high on google i give you my experience.
I bought chilkat in 2015 and moved to libcurl later and my own implementation much later. Both are far from perfect. libcurl just shows it's age and some weak designs.
libCurl is an library that tries to implement all URL able protocols even if they are designed as stream protocol like FTP. Do yourself a favour and only use it with HTTP/HTTPS. It just does the transfer part. Which is not enough for handling. You would love to see at least mime and charset routines to use the downloaded files.
Chilkat is a toplevel library that tries to give you as much highlevel access as possible. It uses background threads in script languages where it is not easy to use. The problem is that the API is terrible, very little documented and total failure when you want to write a quality program. For example it returns requests as a string. There is no way for stream processing. Now imagine you download a large GB iso file, you wont be happy. It can return as a file but then you have to specify this at the begin of a request when you don't knwo the download size.
Also the code quality until proven otherwise is bad. There are a few chilkat source code snippets in the wild which you can find via google and they are pure madness. Ok we don't know how this old code has been refactored now. But it leaves a bad taste, remember this is closed source and there is not a single mention about corner cases, which protocol is implemented, which feature of protocols are implemented and so on. You are using a total black box.
Also it does not allow high performance and high value code. I used it to write a web crawler and it was much much slower then libcurl.
I later used the HTTP and SSH compoenents to automate some server/client management scripts and there it shines. You know both sides and can just test if they work together and don't get any surprises. Then it is indeed easy and better then using the broken python or ruby SSH.
But if you ever contact with another unknown server, Chilkat is not your library.

GNUstep NSString.m file

I'm using GNUstep to begin with learning Objective-C.
I could find the header files for all, but don't know where to find its implementation files.
I was thinking, with that I can understand the whole programming style and many more.
I am working without mac , so if some body knows about any good tutorials , that i can use to identify structure of every Classes.
For instance, i have to parse an xml file, just to learn,
but don't know where to start.
Without IDE its hard to find out the sequence, and I don't have got access to any tutorials that best explains this, ( all that i get is in accordance with i-Phone and Cocoa. )
I'm concentrating on console programs, so that I can be thorough with the syntax and language.
Pls help me.
http://gnustep.org/ is the best resource for GNUstep related information, including source and documentation.
GNUStep has some tutorials and definitely the source code available.
You will find that there are small bits and pieces where Cocoa has moved on so GNUStep will not recognize new methods and things like properties or any new objective-2.0 stuff and so on.
Where ever you have the source installed, you can find NSString.m here
/path_to_my_src/gnustep/modules/core/base/Source/NSString.m