babelouest / ulfius

Web Framework to build REST APIs, Webservices or any HTTP endpoint in C language. Can stream large amount of data, integrate JSON data with Jansson, and create websocket services
https://babelouest.github.io/ulfius
GNU Lesser General Public License v2.1
1.08k stars 182 forks source link

Amalgenation function #114

Closed klasik16 closed 5 years ago

klasik16 commented 5 years ago

it will be great to have .c and .h file of that framework its really nice to add single file to project and use it in your solution.

Sound from soul: \Its really difficult to understand how use those frameworks for beginners even when you know programming language. Programmers not just those persons who can make code but also they should transfer information of what they done to possible it use.

These days really required multi platform possibility. So I probably will move on different language... probably Python. because its pretty much impossible to understand how all these things works to make project. Keep learning...

babelouest commented 5 years ago

it will be great to have .c and .h file of that framework its really nice to add single file to project and use it in your solution.

I'm not sure I understand what you need. Can you be more specific? Perhaps give me a sample code for the example?

Programmers not just those persons who can make code but also they should transfer information of what they done to possible it use.

I agree, that's why there is all the documentation available to use Ulfius: INSTALL.md, API.md and all the example programs.

So I probably will move on different language... probably Python

Ulfius isn't the only web framework available, there are many frameworks available in merely all languages, like Python, Nodejs, Java, .NET, Rust, etc. Ulfius' purpose is to provide an easy to use web framework in C language to get the advantage of the C language: lightweight, portable, fast and close to the hardware.

babelouest commented 5 years ago

@klasik16 , any feedback?

klasik16 commented 5 years ago

What about amalgamation?

babelouest commented 5 years ago

Can you explain what you need? I don't understand the term amalgation in that case.

Some example would be nice

klasik16 commented 5 years ago

https://stackoverflow.com/questions/38899001/does-source-code-amalgamation-really-increase-the-performances-of-a-c-or-c-pro Also open62541 are project that using that function so we can compile all project to two files .c and .h and include it in project and easelly use...

babelouest commented 5 years ago

OK so I think I have a better understanding now.

Basically, you need something like that:

$ # Absolutely no warranty that the script below will work!
$ cat src/*.c > ulfius.c
$ cat include/yuarel.h include/u-private.h include/ulfius.h > ulfius.h
$ (cd src && make ../include/ulfius-cfg.h && cp ../include/ulfius-cfg.h ..)
$ # compile ulfius from the files generated, probably something like that
$ gcc -shared -fPIC -Wl,-soname,libulfius.so -o libulfius.so.2.5.0 ulfius.c -lc -lmicrohttpd -lorcania -lpthread -ljansson -lcurl -lgnutls -lyder $(LDFLAGS)

Although, if I can see what you need, i don't understant why.

I don't think it will improve efficiency or speed, and I'm sure it will decrease readability and make it more difficult to navigate through the code, so it won't be my official source format. But if you need to concat all ulfius source code in single .h and .c files, feel free to do it for your own needs.

babelouest commented 5 years ago

@klasik16 ,

Also, you'd have to concatenate all Ulfius dependencies and their dependencies.

I know that Ulfius, Yder and Orcania may be amalgamable, but I have no idea for the external dependencies, especially because I'm a user of those libraries and I don't know them deep enough, you'd have to ask them:

babelouest commented 5 years ago

Hello @klasik16 ,

Any update on this?

klasik16 commented 5 years ago

I'm sorry i'm not professional programmer and now I'm out of project what has task to do before. The point of what lot of users prefer to use and make business projects instead of developing frameworks for them. And ewryone uses diferent IDK fo its really complex for user like me. sorry

babelouest commented 5 years ago

No problem,

Feel free to open new issues if you need.