Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/cubicdaiya/libngxcore
libngxcore is the library built from nginx core APIs.
https://github.com/cubicdaiya/libngxcore
Last synced: 18 days ago
JSON representation
libngxcore is the library built from nginx core APIs.
- Host: GitHub
- URL: https://github.com/cubicdaiya/libngxcore
- Owner: cubicdaiya
- License: bsd-2-clause
- Created: 2013-01-05T11:56:16.000Z (almost 12 years ago)
- Default Branch: master
- Last Pushed: 2015-01-17T09:10:56.000Z (almost 10 years ago)
- Last Synced: 2024-07-31T22:57:05.292Z (3 months ago)
- Language: C
- Homepage:
- Size: 1.46 MB
- Stars: 25
- Watchers: 5
- Forks: 10
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE.libngxcore
Awesome Lists containing this project
- awesome-nginx - libngxcore - libngxcore is the library built from nginx core APIs.. (Tools / Lua Modules)
README
#libngxcore
libngxcore is the library built from nginx core APIs.
## Why is libngxcore needed?
nginx has powerful core APIs. but they are not able to used outside nginx.
If we write a nginx module, we must build a nginx module with nginx.
This way is a pain when we try as quick. libngxcore simplify to try nginx core APIs.For example, Let's try the nginx string API with libngxcore.
```c
#include#include
#include
#includeint main (int argc, char *argv[]) {
ngx_str_t s = ngx_string("bokko");printf("s :%s\n", s.data); // bokko
printf("ngx_strlen(s):%zd\n", ngx_strlen(s.data)); // 5return 0;
}
```Use examples as a reference about Building.
## Build libngxcore.a
```
$ make
```## Build examples
```
$ cd examples && scons
```## Execute examples in Mac OS X
When libngxcore is build in Mac OS X, libngxcore.dylib as not a static library but a shared library is generated.
So set DYLD_LIBRARY_PATH when executing libngxcore examples.```
$ cd examples
$ ./string
dyld: Library not loaded: libngxcore.dylib
Referenced from: /Users/bokko/workspace/libngxcore/examples/./string
Reason: image not found
zsh: trace trap ./string
$ DYLD_LIBRARY_PATH=../ ./string
s :bokko
ngx_strlen(s):5
$
```