Skip to content

Commit

Permalink
Merge pull request #13 from sys4/libredesign
Browse files Browse the repository at this point in the history
Modified directory structure to prepare pre-release
  • Loading branch information
BLohner authored Sep 29, 2024
2 parents c273cae + 4f8e6e2 commit a6738a6
Show file tree
Hide file tree
Showing 24 changed files with 28 additions and 11 deletions.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
The TLSRPT tools are released under the GNU General Public License (GPL) version 3 or later (see doc/COPYING for the license terms).

The TLSRPT C library in the "clibrary" subdirectory is released under the GNU Lesser General Public License (LGPL) version 3 or later (see clibrary/library/doc/COPYING.LESSER for the license terms).
The TLSRPT C library in the "libtlsrpt" subdirectory is released under the GNU Lesser General Public License (LGPL) version 3 or later (see libtlsrpt/COPYING.LESSER for the license terms).
1 change: 0 additions & 1 deletion clibrary/LICENSE

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
:title-page:

= TLSRPT for MTAs - API documentation of the C library
Version 0.04
2024-09-05
Version 0.5.0-pre20240929
2024-09-29

== Error handling

Expand Down Expand Up @@ -204,6 +204,13 @@ The default is non-blocking.
==== `tlsrpt_set_nonblocking`
The `tlsrpt_set_nonblocking` function restores the `sendto` call within `tlsrpt_finish_delivery_request` to its default non-blocking behaviour.

==== `tlsrpt_get_socket`
Parameters:::
truct tlsrpt_connection_t* con:: A pointer to the `tlsrpt_connection_t` struct.

The `tlsrpt_get_socket` function returns the socket file descriptor used within a `tlsrpt_connection_t`.
This can be useful to set socket options.


=== Error code inspection
==== `tlsrpt_errno_from_error_code`
Expand Down
File renamed without changes.
File renamed without changes.
8 changes: 5 additions & 3 deletions clibrary/INSTALL → libtlsrpt/INSTALL
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@ libtlsrpt - Installation

To install the libtlsrpt in /usr/local/lib and the header files to /usr/local/include:

1. Change directory to the library´s source directory
1. Build library

make

2. Call "make install" with PREFIX set to "/usr/local"

cd library/src
make install PREFIX=/usr/local
make install PREFIX=/usr/local

1 change: 1 addition & 0 deletions libtlsrpt/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
The TLSRPT C library is released under the GNU Lesser General Public License (LGPL) version 3 or later (see COPYING.LESSER for the license terms).
8 changes: 4 additions & 4 deletions clibrary/library/src/Makefile → libtlsrpt/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ CC=gcc
INSTALL=install

DEBUG=-g
CFLAGS += -Wall -I ../include -fPIC -O2 ${DEBUG}
CFLAGS += -Wall -I . -fPIC -O2 ${DEBUG}
LDFLAGS += -Wall -L. ${DEBUG}
LDLIBS += libtlsrpt.a

Expand All @@ -42,8 +42,8 @@ libtlsrpt.so : libtlsrpt.o json-escape-initializer-list.o

demo : demo.o libtlsrpt.a

demo.o : ../include/tlsrpt.h
libtlsrpt.o : ../include/tlsrpt.h
demo.o : tlsrpt.h
libtlsrpt.o : tlsrpt.h


json-escape-initializer-list.c : create-json-escape-initializer-list
Expand All @@ -54,4 +54,4 @@ create-json-escape-initializer-list : LDLIBS =

install: ${TARGETLIBS}
${INSTALL} -D -t ${DESTDIR}${PREFIX}/lib ${TARGETLIBS}
${INSTALL} -D -t ${DESTDIR}${PREFIX}/include ../include/tlsrpt.h
${INSTALL} -D -t ${DESTDIR}${PREFIX}/include tlsrpt.h
8 changes: 8 additions & 0 deletions clibrary/library/src/demo.c → libtlsrpt/demo.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include "tlsrpt.h"

Expand Down Expand Up @@ -56,6 +57,13 @@ void testrun() {
res = tlsrpt_finish_delivery_request(&dr);

printf("Result code is %d\n", res);
if(tlsrpt_error_code_is_internal(res)) {
printf("Internal library error : %s\n", tlsrpt_strerror(res));
} else {
int e = tlsrpt_errno_from_error_code(res);
printf("%s : errno=%d : %s\n", tlsrpt_strerror(res), e, strerror(e));
}


tlsrpt_close(&con);

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit a6738a6

Please sign in to comment.