Skip to content

Commit

Permalink
use /usr/local/include
Browse files Browse the repository at this point in the history
  • Loading branch information
aerth committed Nov 6, 2022
1 parent f06445e commit a49aff3
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
17 changes: 14 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,20 @@ first `make` in plugin directory, creating `tgun.a tgun.so tgun.h` and an exampl
#include <tgun.h>
int main(){
char* b = get_url("http://example.org")
printf("%s", b);
free(b);
// set user-agent
easy_ua("libtgun/1.0");
// set proxy url, or alias 'tor' (9050 or 9150 depending on platform) or 'socks' (127.0.0.1:1080)
easy_proxy("tor");
char* b = get_url("http://example.org");
// if any errors, NULL is returned and an error is waiting
if (!b) {
fprintf(stderr, "error: %s\n", tgunerr());
} else {
// normal string, do something with it, then free().
printf("%s", b);
free(b);
}
}
```
Expand Down
3 changes: 2 additions & 1 deletion plugin/makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,6 @@ clean:
install:
install tgun.a /usr/local/lib/libtgun.a
install tgun.so /usr/local/lib/libtgun.so
install tgun.h /usr/include/tgun.h
mkdir -p /usr/local/include
install tgun.h /usr/local/include/tgun.h
@echo now can use -ltgun to link and '#include <tgun.h>'

0 comments on commit a49aff3

Please sign in to comment.