diff --git a/dlib/Makefile.am b/dlib/Makefile.am index f03030d..4f48bb3 100644 --- a/dlib/Makefile.am +++ b/dlib/Makefile.am @@ -4,5 +4,5 @@ AM_CPPFLAGS = \ noinst_LIBRARIES = libDlib.a libDlib_a_SOURCES = \ - dlib.h \ + dlib.hh \ dlib.cc diff --git a/dlib/dlib.cc b/dlib/dlib.cc index 531d62c..280d125 100644 --- a/dlib/dlib.cc +++ b/dlib/dlib.cc @@ -27,7 +27,7 @@ #include #include -#include "dlib.h" +#include "dlib.hh" static bool dLib_show_msg = TRUE; @@ -962,6 +962,27 @@ char *dGetline (FILE *stream) return line; } +std::optional< std::string > +dGetline_string (FILE *stream) +{ + int ch; + Dstr *dstr; + + if( stream == nullptr ) return std::nullopt; + + dstr = dStr_sized_new(64); + while ((ch = fgetc(stream)) != EOF) { + dStr_append_c(dstr, ch); + if (ch == '\n') + break; + } + + std::optional< std::string > line; + if(dstr->len) line= dstr->str; + dStr_free(dstr, 1); + return line; +} + /** * Close a FD handling EINTR. */ diff --git a/dlib/dlib.h b/dlib/dlib.hh similarity index 98% rename from dlib/dlib.h rename to dlib/dlib.hh index 400a15f..4ae7e1b 100644 --- a/dlib/dlib.h +++ b/dlib/dlib.hh @@ -6,7 +6,8 @@ #include /* for va_list */ #include /* for strerror */ -#include +#include +#include #include "d_size.h" @@ -184,6 +185,7 @@ void dLib_show_messages(bool show); */ char *dGetcwd(void); char *dGethomedir(void); +std::optional< std::string > dGetline_string(FILE *stream); char *dGetline(FILE *stream); int dClose(int fd); int dUsleep(unsigned long us); diff --git a/dpi/bookmarks.cc b/dpi/bookmarks.cc index be8e376..ffa81be 100644 --- a/dpi/bookmarks.cc +++ b/dpi/bookmarks.cc @@ -35,7 +35,7 @@ #include #include #include -#include "../dpip/dpip.h" +#include "../dpip/dpip.hh" #include "dpiutil.hh" diff --git a/dpi/cookies.cc b/dpi/cookies.cc index cbebb26..23e9f29 100644 --- a/dpi/cookies.cc +++ b/dpi/cookies.cc @@ -49,7 +49,7 @@ int main(void) #include #include #include "dpiutil.hh" -#include "../dpip/dpip.h" +#include "../dpip/dpip.hh" /* diff --git a/dpi/datauri.cc b/dpi/datauri.cc index 8ccfa3a..f3f7db6 100644 --- a/dpi/datauri.cc +++ b/dpi/datauri.cc @@ -18,7 +18,7 @@ #include #include -#include "../dpip/dpip.h" +#include "../dpip/dpip.hh" #include "dpiutil.hh" #include "../src/misc.hh" diff --git a/dpi/downloads.cc b/dpi/downloads.cc index 4f026b1..ce5d8e6 100644 --- a/dpi/downloads.cc +++ b/dpi/downloads.cc @@ -49,7 +49,7 @@ #include "config.h" #include "dpiutil.hh" -#include "../dpip/dpip.h" +#include "../dpip/dpip.hh" /* * Debugging macros diff --git a/dpi/dpiutil.hh b/dpi/dpiutil.hh index 38a922c..93edccd 100644 --- a/dpi/dpiutil.hh +++ b/dpi/dpiutil.hh @@ -20,7 +20,7 @@ #include #include "d_size.h" -#include "../dlib/dlib.h" +#include "../dlib/dlib.hh" #ifdef __cplusplus diff --git a/dpi/file.cc b/dpi/file.cc index 95c9d39..6ea9ad3 100644 --- a/dpi/file.cc +++ b/dpi/file.cc @@ -34,7 +34,7 @@ #include #include -#include "../dpip/dpip.h" +#include "../dpip/dpip.hh" #include "dpiutil.hh" #include "d_size.h" diff --git a/dpi/ftp.cc b/dpi/ftp.cc index b2e7df3..3ec583c 100644 --- a/dpi/ftp.cc +++ b/dpi/ftp.cc @@ -41,7 +41,7 @@ #include #include -#include "../dpip/dpip.h" +#include "../dpip/dpip.hh" #include "dpiutil.hh" #include "d_size.h" diff --git a/dpi/hello.cc b/dpi/hello.cc index dc325a2..6621692 100644 --- a/dpi/hello.cc +++ b/dpi/hello.cc @@ -18,7 +18,7 @@ #include #include #include -#include "../dpip/dpip.h" +#include "../dpip/dpip.hh" #include "dpiutil.hh" /* diff --git a/dpi/vsource.cc b/dpi/vsource.cc index 07c1374..095f12f 100644 --- a/dpi/vsource.cc +++ b/dpi/vsource.cc @@ -19,7 +19,7 @@ #include #include #include -#include "../dpip/dpip.h" +#include "../dpip/dpip.hh" #include "dpiutil.hh" /* diff --git a/dpid/Makefile.am b/dpid/Makefile.am index 465fa6c..29354bf 100644 --- a/dpid/Makefile.am +++ b/dpid/Makefile.am @@ -14,17 +14,17 @@ dpidc_LDADD = \ EXTRA_DIST = dpidrc.in dpid_SOURCES = \ - dpi.h \ - dpi_socket_dir.h \ - dpid.h \ - dpid_common.h \ - misc_new.h \ + dpi.hh \ + dpi_socket_dir.hh \ + dpid.hh \ + dpid_common.hh \ + misc_new.hh \ dpi.cc \ - dpi_socket_dir.c \ + dpi_socket_dir.cc \ dpid.cc \ - dpid_common.c \ - main.c \ - misc_new.c + dpid_common.cc \ + main.cc \ + misc_new.cc dpidc_SOURCES = dpidc.cc diff --git a/dpid/dpi.cc b/dpid/dpi.cc index e6adf07..965ed3e 100644 --- a/dpid/dpi.cc +++ b/dpid/dpi.cc @@ -23,9 +23,9 @@ #include #include /* for exit */ -#include "dpid_common.h" -#include "dpi.h" -#include "misc_new.h" +#include "dpid_common.hh" +#include "dpi.hh" +#include "misc_new.hh" /*! \Return * Returns path to the dpi_socket_dir file diff --git a/dpid/dpi.h b/dpid/dpi.hh similarity index 100% rename from dpid/dpi.h rename to dpid/dpi.hh diff --git a/dpid/dpi_socket_dir.c b/dpid/dpi_socket_dir.cc similarity index 89% rename from dpid/dpi_socket_dir.c rename to dpid/dpi_socket_dir.cc index b48efb9..ad73e5a 100644 --- a/dpid/dpi_socket_dir.c +++ b/dpid/dpi_socket_dir.cc @@ -21,10 +21,10 @@ #include #include -#include "dpid_common.h" -#include "dpi.h" -#include "misc_new.h" -#include "dpi_socket_dir.h" /* for function prototypes */ +#include "dpid_common.hh" +#include "dpi.hh" +#include "misc_new.hh" +#include "dpi_socket_dir.hh" /* for function prototypes */ /*! Save socket directory name in ~/.dillo/dpi_socket_dir * \Return @@ -76,17 +76,18 @@ int tst_dir(char *dir) */ char *mk_sockdir(void) { - char *template, *logname; + char *template_; + const char *logname; logname = getenv("LOGNAME") ? getenv("LOGNAME") : "flenser"; - template = dStrconcat("/tmp/", logname, "-", "XXXXXX", NULL); - if (a_Misc_mkdtemp(template) == NULL) { + template_ = dStrconcat("/tmp/", logname, "-", "XXXXXX", NULL); + if (a_Misc_mkdtemp(template_) == NULL) { ERRMSG("mk_sockdir", "a_Misc_mkdtemp", 0); - MSG_ERR(" - %s\n", template); - dFree(template); + MSG_ERR(" - %s\n", template_); + dFree(template_); return (NULL); } - return template; + return template_; } /*! Create socket directory if it does not exist and save its name in diff --git a/dpid/dpi_socket_dir.h b/dpid/dpi_socket_dir.hh similarity index 100% rename from dpid/dpi_socket_dir.h rename to dpid/dpi_socket_dir.hh diff --git a/dpid/dpid.cc b/dpid/dpid.cc index b969081..0b14258 100644 --- a/dpid/dpid.cc +++ b/dpid/dpid.cc @@ -31,13 +31,13 @@ #include #include -#include "dpid_common.h" -#include "dpid.h" -#include "dpi.h" -#include "dpi_socket_dir.h" -#include "misc_new.h" +#include "dpid_common.hh" +#include "dpid.hh" +#include "dpi.hh" +#include "dpi_socket_dir.hh" +#include "misc_new.hh" -#include "../dpip/dpip.h" +#include "../dpip/dpip.hh" using namespace std::literals::string_literals; diff --git a/dpid/dpid.h b/dpid/dpid.hh similarity index 100% rename from dpid/dpid.h rename to dpid/dpid.hh diff --git a/dpid/dpid_common.c b/dpid/dpid_common.cc similarity index 98% rename from dpid/dpid_common.c rename to dpid/dpid_common.cc index 8c6c6bf..e7e89bf 100644 --- a/dpid/dpid_common.c +++ b/dpid/dpid_common.cc @@ -12,7 +12,7 @@ #include #include #include -#include "dpid_common.h" +#include "dpid_common.hh" /* * Send a verbose error message. diff --git a/dpid/dpid_common.h b/dpid/dpid_common.hh similarity index 97% rename from dpid/dpid_common.h rename to dpid/dpid_common.hh index cac9590..2df9ad2 100644 --- a/dpid/dpid_common.h +++ b/dpid/dpid_common.hh @@ -9,16 +9,17 @@ * the next patch */ -#ifdef __cplusplus -extern "C" -{ -#endif #include #include /* size_t */ #include /* ssize_t */ -#include "../dlib/dlib.h" +#include "../dlib/dlib.hh" + +#ifdef __cplusplus +extern "C" +{ +#endif /* * Debugging macros diff --git a/dpid/dpidc.cc b/dpid/dpidc.cc index 8947384..9fcd606 100644 --- a/dpid/dpidc.cc +++ b/dpid/dpidc.cc @@ -20,8 +20,8 @@ #include #include -#include "../dlib/dlib.h" -#include "../dpip/dpip.h" +#include "../dlib/dlib.hh" +#include "../dpip/dpip.hh" #define MSG_ERR(...) printf("** ERROR **: " __VA_ARGS__); diff --git a/dpid/main.c b/dpid/main.cc similarity index 98% rename from dpid/main.c rename to dpid/main.cc index 5bd2ad9..1ca1cea 100644 --- a/dpid/main.c +++ b/dpid/main.cc @@ -24,14 +24,14 @@ #include /* for assert */ #include /* for umask */ -#include "dpid_common.h" -#include "dpid.h" -#include "dpi.h" -#include "dpi_socket_dir.h" -#include "misc_new.h" +#include "dpid_common.hh" +#include "dpid.hh" +#include "dpi.hh" +#include "dpi_socket_dir.hh" +#include "misc_new.hh" -#include "../dlib/dlib.h" -#include "../dpip/dpip.h" +#include "../dlib/dlib.hh" +#include "../dpip/dpip.hh" sigset_t mask_sigchld; diff --git a/dpid/misc_new.c b/dpid/misc_new.cc similarity index 90% rename from dpid/misc_new.c rename to dpid/misc_new.cc index e0efc5a..b306057 100644 --- a/dpid/misc_new.c +++ b/dpid/misc_new.cc @@ -15,9 +15,9 @@ #include /* stat */ #include /* rand, srand */ -#include "../dlib/dlib.h" -#include "dpid_common.h" -#include "misc_new.h" /* for function prototypes */ +#include "../dlib/dlib.hh" +#include "dpid_common.hh" +#include "misc_new.hh" /* for function prototypes */ /*! Reads a dpi tag from a socket * \li Continues after a signal interrupt @@ -128,30 +128,30 @@ int a_Misc_nohang_rdtag(int socket, int timeout, Dstr **tag) * Alternative to mkdtemp(). * Not as strong as mkdtemp, but enough for creating a directory. */ -char *a_Misc_mkdtemp(char *template) +char *a_Misc_mkdtemp(char *template_) { for (;;) { - if (a_Misc_mkfname(template) && mkdir(template, 0700) == 0) + if (a_Misc_mkfname(template_) && mkdir(template_, 0700) == 0) break; if (errno == EEXIST) continue; return 0; } - return template; + return template_; } /** * Return a new, nonexistent file name from a template. * (adapted from dietlibc; alternative to mkdtemp()) */ -char *a_Misc_mkfname(char *template) +char *a_Misc_mkfname(char *template_) { - char *tmp = template + strlen(template) - 6; + char *tmp = template_ + strlen(template_) - 6; int i; uint_t random; struct stat stat_buf; - if (tmp < template) + if (tmp < template_) goto error; for (i = 0; i < 6; ++i) if (tmp[i] != 'X') { @@ -168,10 +168,10 @@ char *a_Misc_mkfname(char *template) tmp[i] = hexdigit > 9 ? hexdigit + 'a' - 10 : hexdigit + '0'; } - if (stat(template, &stat_buf) == -1 && errno == ENOENT) - return template; + if (stat(template_, &stat_buf) == -1 && errno == ENOENT) + return template_; - MSG_ERR("a_Misc_mkfname: another round for %s \n", template); + MSG_ERR("a_Misc_mkfname: another round for %s \n", template_); } } diff --git a/dpid/misc_new.h b/dpid/misc_new.hh similarity index 100% rename from dpid/misc_new.h rename to dpid/misc_new.hh diff --git a/dpip/Makefile.am b/dpip/Makefile.am index 13090c2..73193ad 100644 --- a/dpip/Makefile.am +++ b/dpip/Makefile.am @@ -4,5 +4,5 @@ AM_CPPFLAGS = \ noinst_LIBRARIES = libDpip.a libDpip_a_SOURCES = \ - dpip.h \ - dpip.c + dpip.hh \ + dpip.cc diff --git a/dpip/dpip.c b/dpip/dpip.cc similarity index 99% rename from dpip/dpip.c rename to dpip/dpip.cc index 2f4dd7a..b4cc1eb 100644 --- a/dpip/dpip.c +++ b/dpip/dpip.cc @@ -19,7 +19,7 @@ #include /* for close */ #include /* for fcntl */ -#include "dpip.h" +#include "dpip.hh" #include "d_size.h" #define RBUF_SZ 16*1024 diff --git a/dpip/dpip.h b/dpip/dpip.hh similarity index 98% rename from dpip/dpip.h rename to dpip/dpip.hh index f2e7f0c..f997963 100644 --- a/dpip/dpip.h +++ b/dpip/dpip.hh @@ -5,12 +5,12 @@ #ifndef __DPIP_H__ #define __DPIP_H__ +#include "../dlib/dlib.hh" + #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ -#include "../dlib/dlib.h" - /* * Communication mode flags */ diff --git a/dw/findtext.cc b/dw/findtext.cc index 765369a..11a21b7 100644 --- a/dw/findtext.cc +++ b/dw/findtext.cc @@ -20,7 +20,7 @@ #include "core.hh" -#include "dlib/dlib.h" +#include "dlib/dlib.hh" #include "../lout/debug.hh" #include "../lout/msg.h" diff --git a/dw/fltkplatform.cc b/dw/fltkplatform.cc index 8c7bc66..53e7ae3 100644 --- a/dw/fltkplatform.cc +++ b/dw/fltkplatform.cc @@ -19,7 +19,7 @@ #include -#include "dlib/dlib.h" +#include "dlib/dlib.hh" #include "../lout/msg.h" #include "../lout/debug.hh" #include "fltkcore.hh" diff --git a/dw/fltkui.cc b/dw/fltkui.cc index 0fa0f87..0676754 100644 --- a/dw/fltkui.cc +++ b/dw/fltkui.cc @@ -25,7 +25,7 @@ #include "fltkcore.hh" #include "fltkflatview.hh" #include "fltkcomplexbutton.hh" -#include "dlib/dlib.h" +#include "dlib/dlib.hh" #include "../lout/msg.h" #include "../lout/misc.hh" diff --git a/dw/hyphenator.cc b/dw/hyphenator.cc index ee4eeca..779b74c 100644 --- a/dw/hyphenator.cc +++ b/dw/hyphenator.cc @@ -21,7 +21,7 @@ #include "hyphenator.hh" -#include "dlib/dlib.h" +#include "dlib/dlib.hh" #include "../lout/misc.hh" #include "../lout/unicode.hh" #include diff --git a/dw/image.cc b/dw/image.cc index 55cce25..914bb20 100644 --- a/dw/image.cc +++ b/dw/image.cc @@ -22,7 +22,7 @@ //#define DEBUG_LEVEL 1 #include "image.hh" -#include "dlib/dlib.h" +#include "dlib/dlib.hh" #include "../lout/msg.h" #include "../lout/misc.hh" #include "../lout/debug.hh" diff --git a/dw/layout.cc b/dw/layout.cc index 875636a..093e50a 100644 --- a/dw/layout.cc +++ b/dw/layout.cc @@ -22,7 +22,7 @@ #include "core.hh" -#include "dlib/dlib.h" +#include "dlib/dlib.hh" #include "../lout/msg.h" #include "../lout/debug.hh" #include "../lout/misc.hh" diff --git a/dw/style.cc b/dw/style.cc index 55d1a60..98c778a 100644 --- a/dw/style.cc +++ b/dw/style.cc @@ -26,7 +26,7 @@ static_assert( __cplusplus > 2020'02 ); #include -#include "dlib/dlib.h" +#include "dlib/dlib.hh" #include "core.hh" #include "../lout/msg.h" diff --git a/lout/misc.hh b/lout/misc.hh index c9e30cc..c2d59d8 100644 --- a/lout/misc.hh +++ b/lout/misc.hh @@ -26,7 +26,7 @@ #include #include #include -#include "dlib/dlib.h" +#include "dlib/dlib.hh" namespace lout { diff --git a/lout/object.cc b/lout/object.cc index 6041237..30c966c 100644 --- a/lout/object.cc +++ b/lout/object.cc @@ -20,7 +20,7 @@ #include "object.hh" -#include "dlib/dlib.h" +#include "dlib/dlib.hh" #include #include #include diff --git a/src/IO/IO.cc b/src/IO/IO.cc index bc894ee..9cea750 100644 --- a/src/IO/IO.cc +++ b/src/IO/IO.cc @@ -18,7 +18,7 @@ #include #include "../msg.hh" #include "../chain.hh" -#include "../klist.h" +#include "../klist.hh" #include "IO.hh" #include "iowatch.hh" #include "tls.hh" diff --git a/src/IO/IO.hh b/src/IO/IO.hh index e5e4c19..a178d40 100644 --- a/src/IO/IO.hh +++ b/src/IO/IO.hh @@ -4,7 +4,7 @@ #include #include "d_size.h" -#include "../../dlib/dlib.h" +#include "../../dlib/dlib.hh" #include "../chain.hh" /* diff --git a/src/IO/Url.h b/src/IO/Url.h index e90f004..1b093c3 100644 --- a/src/IO/Url.h +++ b/src/IO/Url.h @@ -3,7 +3,7 @@ #include "../chain.hh" #include "../url.hh" -#include "../../dlib/dlib.h" +#include "../../dlib/dlib.hh" #ifdef __cplusplus extern "C" { diff --git a/src/IO/dpi.cc b/src/IO/dpi.cc index 6850e90..f904aed 100644 --- a/src/IO/dpi.cc +++ b/src/IO/dpi.cc @@ -36,11 +36,11 @@ #include #include "../msg.hh" -#include "../klist.h" +#include "../klist.hh" #include "IO.hh" #include "Url.h" -#include "../../dpip/dpip.h" -#include "dlib/dlib.h" +#include "../../dpip/dpip.hh" +#include "dlib/dlib.hh" /* This one is tricky, some sources state it should include the byte * for the terminating NULL, and others say it shouldn't. */ diff --git a/src/IO/http.cc b/src/IO/http.cc index 79ed346..4486986 100644 --- a/src/IO/http.cc +++ b/src/IO/http.cc @@ -32,7 +32,7 @@ #include "tls.hh" #include "Url.h" #include "../msg.hh" -#include "../klist.h" +#include "../klist.hh" #include "../dns.hh" #include "../web.hh" #include "../cookies.hh" diff --git a/src/IO/mime.hh b/src/IO/mime.hh index d54a947..753515b 100644 --- a/src/IO/mime.hh +++ b/src/IO/mime.hh @@ -14,13 +14,13 @@ #include +#include "../cache.hh" + #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ -#include "../cache.hh" - typedef void* (*Viewer_t) (const char*, void*, CA_Callback_t*, void**); /** diff --git a/src/IO/tls_openssl.cc b/src/IO/tls_openssl.cc index 91fca43..65bfb78 100644 --- a/src/IO/tls_openssl.cc +++ b/src/IO/tls_openssl.cc @@ -45,9 +45,9 @@ #include /* tolower for wget stuff */ #include #include -#include "../../dlib/dlib.h" +#include "../../dlib/dlib.hh" #include "../dialog.hh" -#include "../klist.h" +#include "../klist.hh" #include "iowatch.hh" #include "tls.hh" #include "Url.h" diff --git a/src/IO/tls_openssl.hh b/src/IO/tls_openssl.hh index 3bdeea6..df0fc88 100644 --- a/src/IO/tls_openssl.hh +++ b/src/IO/tls_openssl.hh @@ -25,12 +25,12 @@ #ifndef __TLS_OPENSSL_H__ #define __TLS_OPENSSL_H__ +#include "../url.hh" + #ifdef __cplusplus extern "C" { #endif -#include "../url.hh" - const char *a_Tls_openssl_version(char *buf, int n); void a_Tls_openssl_init(void); int a_Tls_openssl_certificate_is_clean(const DilloUrl *url); diff --git a/src/Makefile.am b/src/Makefile.am index 0a3e5d2..f949bd0 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -68,8 +68,8 @@ flenser_SOURCES = \ url.hh \ bitvec.cc \ bitvec.hh \ - klist.c \ - klist.h \ + klist.cc \ + klist.hh \ chain.cc \ chain.hh \ utf8.cc \ diff --git a/src/actions.cc b/src/actions.cc index 6daa5a7..d284697 100644 --- a/src/actions.cc +++ b/src/actions.cc @@ -11,7 +11,7 @@ #include "actions.hh" #include "msg.hh" -#include "../dlib/dlib.h" +#include "../dlib/dlib.hh" #include static Dlist *link_actions = NULL; diff --git a/src/actions.hh b/src/actions.hh index 9848716..4e96afc 100644 --- a/src/actions.hh +++ b/src/actions.hh @@ -12,12 +12,12 @@ #ifndef ACTIONS_H #define ACTIONS_H +#include "dlib/dlib.hh" + #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ -#include "dlib/dlib.h" - typedef struct { char *label; char *cmd; diff --git a/src/auth.cc b/src/auth.cc index 0dae68f..9bf80ab 100644 --- a/src/auth.cc +++ b/src/auth.cc @@ -23,7 +23,7 @@ #include "misc.hh" #include "dialog.hh" #include "digest.hh" -#include "../dlib/dlib.h" +#include "../dlib/dlib.hh" typedef struct { int ok; diff --git a/src/bitvec.cc b/src/bitvec.cc index 73069d1..9857409 100644 --- a/src/bitvec.cc +++ b/src/bitvec.cc @@ -13,7 +13,7 @@ * A simple ADT for bit arrays */ -#include "../dlib/dlib.h" +#include "../dlib/dlib.hh" #include "bitvec.hh" extern "C" { diff --git a/src/bookmark.cc b/src/bookmark.cc index 381bc00..1c98a20 100644 --- a/src/bookmark.cc +++ b/src/bookmark.cc @@ -15,7 +15,7 @@ #include "history.hh" #include "capi.hh" #include "bookmark.hh" /* for prototypes */ -#include "../dpip/dpip.h" +#include "../dpip/dpip.hh" diff --git a/src/cache.hh b/src/cache.hh index 53765ed..3f2475d 100644 --- a/src/cache.hh +++ b/src/cache.hh @@ -1,14 +1,15 @@ #ifndef __CACHE_H__ #define __CACHE_H__ -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - #include "chain.hh" #include "url.hh" + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + /* * Cache Op codes */ diff --git a/src/capi.cc b/src/capi.cc index 455ca81..6377279 100644 --- a/src/capi.cc +++ b/src/capi.cc @@ -31,7 +31,7 @@ #include "dpiapi.hh" #include "uicmd.hh" #include "domain.hh" -#include "../dpip/dpip.h" +#include "../dpip/dpip.hh" #include "prefs.hh" /* for testing dpi chat */ diff --git a/src/chain.cc b/src/chain.cc index aba4f16..acedb55 100644 --- a/src/chain.cc +++ b/src/chain.cc @@ -15,7 +15,7 @@ #include "msg.hh" #include "chain.hh" -#include "../dlib/dlib.h" +#include "../dlib/dlib.hh" #define VERBOSE 0 diff --git a/src/cookies.cc b/src/cookies.cc index c3c760c..64d1f4e 100644 --- a/src/cookies.cc +++ b/src/cookies.cc @@ -43,7 +43,7 @@ void a_Cookies_init(void) #include "list.h" #include "cookies.hh" #include "capi.hh" -#include "../dpip/dpip.h" +#include "../dpip/dpip.hh" /** The maximum length of a line in the cookie file */ diff --git a/src/css.cc b/src/css.cc index 377ec63..0a5c943 100644 --- a/src/css.cc +++ b/src/css.cc @@ -10,7 +10,7 @@ */ #include -#include "../dlib/dlib.h" +#include "../dlib/dlib.hh" #include "msg.hh" #include "html_common.hh" #include "css.hh" diff --git a/src/decode.hh b/src/decode.hh index e959826..d4ffd26 100644 --- a/src/decode.hh +++ b/src/decode.hh @@ -1,7 +1,7 @@ #ifndef __DECODE_H__ #define __DECODE_H__ -#include "../dlib/dlib.h" +#include "../dlib/dlib.hh" #ifdef __cplusplus extern "C" { diff --git a/src/dgif.hh b/src/dgif.hh index cebfdf4..49441ca 100644 --- a/src/dgif.hh +++ b/src/dgif.hh @@ -1,13 +1,13 @@ #ifndef __GIF_H__ #define __GIF_H__ +#include "url.hh" +#include "image.hh" + #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ -#include "url.hh" -#include "image.hh" - struct DilloGif; DilloGif *a_Gif_new(DilloImage *Image, DilloUrl *url, int version); diff --git a/src/dialog.cc b/src/dialog.cc index 72a0979..eb3337b 100644 --- a/src/dialog.cc +++ b/src/dialog.cc @@ -37,7 +37,7 @@ #include "dialog.hh" #include "misc.hh" #include "prefs.hh" -#include "dlib/dlib.h" +#include "dlib/dlib.hh" /* * Local Data diff --git a/src/digest.cc b/src/digest.cc index f229939..b39a8ee 100644 --- a/src/digest.cc +++ b/src/digest.cc @@ -13,7 +13,7 @@ #include "digest.hh" #include "md5.h" #include "msg.hh" -#include "../dlib/dlib.h" +#include "../dlib/dlib.hh" #include diff --git a/src/digest.hh b/src/digest.hh index 4a991b6..e92e538 100644 --- a/src/digest.hh +++ b/src/digest.hh @@ -2,7 +2,7 @@ #define __DIGEST_H__ #include "auth.hh" -#include "../dlib/dlib.h" +#include "../dlib/dlib.hh" #ifdef __cplusplus extern "C" { diff --git a/src/djpeg.hh b/src/djpeg.hh index ea879be..fb983e2 100644 --- a/src/djpeg.hh +++ b/src/djpeg.hh @@ -1,13 +1,14 @@ #ifndef __JPEG_H__ #define __JPEG_H__ +#include "url.hh" +#include "image.hh" + + #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ -#include "url.hh" -#include "image.hh" - void *a_Jpeg_new(DilloImage *Image, DilloUrl *url, int version); void a_Jpeg_callback(int Op, void *data); diff --git a/src/domain.cc b/src/domain.cc index b9cf094..5787d67 100644 --- a/src/domain.cc +++ b/src/domain.cc @@ -12,7 +12,7 @@ #include #include -#include "../dlib/dlib.h" +#include "../dlib/dlib.hh" #include "msg.hh" #include "list.h" #include "domain.hh" diff --git a/src/dpiapi.cc b/src/dpiapi.cc index 5dd7220..10e4c9f 100644 --- a/src/dpiapi.cc +++ b/src/dpiapi.cc @@ -18,7 +18,7 @@ #include "capi.hh" #include "dpiapi.hh" /* for prototypes */ #include "dialog.hh" -#include "../dpip/dpip.h" +#include "../dpip/dpip.hh" //---------------------------------------------------------------------------- diff --git a/src/dpng.hh b/src/dpng.hh index cd19f21..6a0b5cd 100644 --- a/src/dpng.hh +++ b/src/dpng.hh @@ -1,16 +1,16 @@ #ifndef __PNG_H__ #define __PNG_H__ +#include "url.hh" +#include "image.hh" +#include "cache.hh" + #ifdef __cplusplus extern "C" { #else #error PNG header is now C++ only #endif /* __cplusplus */ -#include "url.hh" -#include "image.hh" -#include "cache.hh" - struct DilloPng; DilloPng *a_Png_new(DilloImage *Image, DilloUrl *url, int version); diff --git a/src/dsvg.hh b/src/dsvg.hh index e6d3076..1052866 100644 --- a/src/dsvg.hh +++ b/src/dsvg.hh @@ -1,14 +1,14 @@ #ifndef __SVG_H__ #define __SVG_H__ -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - #include "url.hh" #include "image.hh" #include "cache.hh" +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + void *a_Svg_new(DilloImage *Image, DilloUrl *url, int version); void a_Svg_callback(int Op, CacheClient_t *Client); diff --git a/src/dwebp.hh b/src/dwebp.hh index be77fc2..a0a6c7f 100644 --- a/src/dwebp.hh +++ b/src/dwebp.hh @@ -1,14 +1,15 @@ #ifndef __WEBP_H__ #define __WEBP_H__ -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ #include "url.hh" #include "image.hh" +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + void *a_Webp_new(DilloImage *Image, DilloUrl *url, int version); void a_Webp_callback(int Op, void *data); const char *a_Webp_version(char *buf, int n); diff --git a/src/form.cc b/src/form.cc index 8156495..1a6ec9a 100644 --- a/src/form.cc +++ b/src/form.cc @@ -20,7 +20,7 @@ #include "dw/core.hh" #include "dw/textblock.hh" -#include "dlib/dlib.h" +#include "dlib/dlib.hh" #include "misc.hh" #include "msg.hh" #include "prefs.hh" diff --git a/src/hsts.cc b/src/hsts.cc index cfb69ad..aa00aa4 100644 --- a/src/hsts.cc +++ b/src/hsts.cc @@ -31,7 +31,7 @@ #include "hsts.hh" #include "msg.hh" -#include "../dlib/dlib.h" +#include "../dlib/dlib.hh" #include "IO/tls.hh" #include diff --git a/src/keys.cc b/src/keys.cc index 6cda51a..052535b 100644 --- a/src/keys.cc +++ b/src/keys.cc @@ -16,7 +16,7 @@ #include #include -#include "dlib/dlib.h" +#include "dlib/dlib.hh" #include "keys.hh" #include "utf8.hh" #include "msg.hh" diff --git a/src/klist.c b/src/klist.cc similarity index 99% rename from src/klist.c rename to src/klist.cc index d68d166..ef8116f 100644 --- a/src/klist.c +++ b/src/klist.cc @@ -18,7 +18,7 @@ * remains with the caller. */ -#include "klist.h" +#include "klist.hh" /** diff --git a/src/klist.h b/src/klist.hh similarity index 96% rename from src/klist.h rename to src/klist.hh index 461f88f..82b551c 100644 --- a/src/klist.h +++ b/src/klist.hh @@ -1,7 +1,7 @@ #ifndef __KLIST_H__ #define __KLIST_H__ -#include "../dlib/dlib.h" +#include "../dlib/dlib.hh" #ifdef __cplusplus diff --git a/src/paths.cc b/src/paths.cc index ca9edfc..8bb67b1 100644 --- a/src/paths.cc +++ b/src/paths.cc @@ -14,7 +14,7 @@ #include #include "msg.hh" -#include "../dlib/dlib.h" +#include "../dlib/dlib.hh" #include "paths.hh" /* diff --git a/src/styleengine.cc b/src/styleengine.cc index f0f73df..7ccd4ed 100644 --- a/src/styleengine.cc +++ b/src/styleengine.cc @@ -10,7 +10,7 @@ * (at your option) any later version. */ -#include "../dlib/dlib.h" +#include "../dlib/dlib.hh" #include "msg.hh" #include "prefs.hh" #include "misc.hh" diff --git a/src/tipwin.cc b/src/tipwin.cc index 4d3583c..0e49dcb 100644 --- a/src/tipwin.cc +++ b/src/tipwin.cc @@ -27,7 +27,7 @@ #include "prefs.hh" #include "tipwin.hh" -#include "dlib/dlib.h" +#include "dlib/dlib.hh" /* * Forward declarations diff --git a/src/uicmd.cc b/src/uicmd.cc index 31ee70d..a818e4c 100644 --- a/src/uicmd.cc +++ b/src/uicmd.cc @@ -46,7 +46,7 @@ #include "msg.hh" #include "prefs.hh" #include "misc.hh" -#include "dlib/dlib.h" +#include "dlib/dlib.hh" #include "dw/fltkviewport.hh" diff --git a/src/url.hh b/src/url.hh index 8a55826..36e6fcb 100644 --- a/src/url.hh +++ b/src/url.hh @@ -13,7 +13,7 @@ #define __URL_H__ #include "d_size.h" -#include "../dlib/dlib.h" +#include "../dlib/dlib.hh" extern "C++" { diff --git a/src/utf8.cc b/src/utf8.cc index e180f8e..548edf6 100644 --- a/src/utf8.cc +++ b/src/utf8.cc @@ -11,7 +11,7 @@ #include -#include "../dlib/dlib.h" /* TRUE/FALSE */ +#include "../dlib/dlib.hh" /* TRUE/FALSE */ #include "utf8.hh" // C++ functions with C linkage ----------------------------------------------