Verified Commit 0c0bf2b3 authored by Tomáš Stefan's avatar Tomáš Stefan
Browse files

code refactoring - comment unused labels, make fn static, ..

parent ec58ca86
Loading
Loading
Loading
Loading
+11 −8
Original line number Diff line number Diff line
@@ -4,14 +4,8 @@ project(pdf_sigil)
set(CMAKE_C_STANDARD 11)
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -pedantic")

# add OpenSSL
#set (OPENSSL_USE_STATIC_LIBS TRUE)
#include(FindOpenSSL)
#find_package(OpenSSL REQUIRED)

# header files
include_directories(include)
#include_directories(${OPENSSL_INCLUDE_DIR})

file(GLOB LIB_SRC "lib/*.c")
set (TEST_SRC "test/test.c")
@@ -20,8 +14,6 @@ set (TEST_SRC "test/test.c")
add_library(pdfsigil_static STATIC ${LIB_SRC})
add_library(pdfsigil SHARED ${LIB_SRC})

#target_link_libraries(pdf-sigil_static ${OPENSSL_LIBRARIES} dl pthread)
#target_link_libraries(pdf-sigil_shared ${OPENSSL_LIBRARIES} dl pthread)
target_link_libraries(pdfsigil_static crypto)
target_link_libraries(pdfsigil crypto)

@@ -29,6 +21,17 @@ target_link_libraries(pdfsigil crypto)
add_executable(selftest ${TEST_SRC})
target_link_libraries(selftest pdfsigil)

# find Doxygen package for generating the documentation
find_package(Doxygen)
if (DOXYGEN_FOUND)
    add_custom_target(doc ALL
        COMMAND ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile
        WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
        COMMENT "Generating Doxygen documentation")
else (DOXYGEN_FOUND)
    message("Install Doxygen for generation of the documentation")
endif (DOXYGEN_FOUND)

# running selftest
add_custom_target(run_tests ALL
    COMMAND selftest
+5 −0
Original line number Diff line number Diff line
@@ -15,6 +15,11 @@
 */
sigil_err_t parse_certs(sigil_t *sgl);

/** @brief Cleans-up the provided cert_t structure
 *
 */
void cert_free(cert_t *cert);

/** @brief Tests for the cert module
 *
 * @param verbosity output level - 0 means nothing, 1 prints module names with
+6 −0
Original line number Diff line number Diff line
@@ -14,6 +14,12 @@
 */
sigil_err_t parse_contents(sigil_t *sgl);

/** Cleans-up the contents entry from the context
 *
 * @param sgl context
 */
void contents_free(sigil_t *sgl);

/** @brief Tests for the contents module
 *
 * @param verbosity output level - 0 means nothing, 1 prints module names with
+0 −11
Original line number Diff line number Diff line
@@ -7,17 +7,6 @@

#include "types.h"

/** @brief Converts hexadecimal characters to the decimal value. Operates with
 *         characters both on input and output, 2 chars on the input produces
 *         1 char on the output
 *
 * @param in input - hexadecimal characters
 * @param in_len length of the input
 * @param out output buffer
 * @param out_len length of the output written (without the terminating null)
 * @return ERR_NONE if success
 */
sigil_err_t hex_to_dec(const char *in, size_t in_len, unsigned char *out, size_t *out_len);

void print_computed_hash(sigil_t *sgl);

+0 −11
Original line number Diff line number Diff line
@@ -129,17 +129,6 @@ sigil_err_t sigil_get_computed_digest(sigil_t *sgl, ASN1_OCTET_STRING **digest);
 */
sigil_err_t sigil_get_subfilter(sigil_t *sgl, int *subfilter);

/** @brief Cleans-up the provided cert_t structure
 *
 */
void cert_free(cert_t *cert);

/** Cleans-up the contents entry from the context
 *
 * @param sgl context
 */
void contents_free(sigil_t *sgl);

/** @brief Cleans-up the provided sigil context
 *
 * @param sgl context
Loading