feat(is-thread-safe): initial commit
This commit is contained in:
parent
fbc1b118ca
commit
31cc771eda
|
@ -0,0 +1,17 @@
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <libpq-fe.h>
|
||||||
|
|
||||||
|
int main(int argc, char **argv) {
|
||||||
|
/*declarations*/
|
||||||
|
int isThreadSafe=0;
|
||||||
|
printf("main() Started...\n");
|
||||||
|
isThreadSafe=PQisthreadsafe();
|
||||||
|
if(isThreadSafe==1){
|
||||||
|
printf("main() libpq is thread-safe\n");
|
||||||
|
}else{
|
||||||
|
printf("main() libpq is NOT thread-safe\n");
|
||||||
|
}
|
||||||
|
printf("main() Done.\n");
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
|
@ -0,0 +1,24 @@
|
||||||
|
# Docu
|
||||||
|
#
|
||||||
|
#$@ is the name of the file to be made
|
||||||
|
#$? is the names of the changed dependents
|
||||||
|
#$< the name of the related file that caused the action
|
||||||
|
#$* the prefix shared by target and dependent files
|
||||||
|
#
|
||||||
|
# Others
|
||||||
|
RM = /bin/rm -f
|
||||||
|
#
|
||||||
|
# Source, Executable, Includes, Library Defines
|
||||||
|
EXE = main
|
||||||
|
#
|
||||||
|
# Compiler, Linker Defines
|
||||||
|
CC = /usr/bin/gcc
|
||||||
|
#
|
||||||
|
all: main.o
|
||||||
|
$(CC) main.c -I/usr/include/postgresql -L/usr/lib/x86_64-linux-gnu -lpq -std=c99 -Wall -o $(EXE)
|
||||||
|
#
|
||||||
|
main.o:
|
||||||
|
$(CC) -c main.c -I/usr/include/postgresql
|
||||||
|
# Clean Up Objects, Exectuables, Dumps out of source directory
|
||||||
|
clean:
|
||||||
|
$(RM) *.o $(EXE) *~
|
|
@ -0,0 +1,23 @@
|
||||||
|
* build
|
||||||
|
|
||||||
|
```
|
||||||
|
make
|
||||||
|
```
|
||||||
|
|
||||||
|
* run
|
||||||
|
|
||||||
|
```
|
||||||
|
./main 'postgresql://begerad:secret@localhost:5432/sib00_vbn_gtfs'
|
||||||
|
```
|
||||||
|
|
||||||
|
* or run
|
||||||
|
|
||||||
|
```
|
||||||
|
./main 'postgresql://begerad:secret@localhost:5432/vbn_data'
|
||||||
|
```
|
||||||
|
|
||||||
|
* or run
|
||||||
|
|
||||||
|
```
|
||||||
|
./main "host=localhost port=5432 user=begerad password=<secret> dbname=vbn_data"
|
||||||
|
```
|
Loading…
Reference in New Issue