mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
Create a network-utils module for net communications code.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@5362 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
parent
4a757d9396
commit
a0385b8ada
@ -721,6 +721,8 @@ AC_OUTPUT(
|
||||
src/import-export/qif-import/Makefile
|
||||
src/import-export/qif-io-core/Makefile
|
||||
src/import-export/qif-io-core/test/Makefile
|
||||
src/network-utils/Makefile
|
||||
src/network-utils/test/Makefile
|
||||
src/optional/Makefile
|
||||
src/optional/swig/Makefile
|
||||
src/pixmaps/Makefile
|
||||
|
@ -3,6 +3,7 @@ SUBDIRS = \
|
||||
doc \
|
||||
gnc-module \
|
||||
test-core \
|
||||
network-utils \
|
||||
engine \
|
||||
backend \
|
||||
calculation \
|
||||
@ -32,6 +33,7 @@ gnucash_LDADD = \
|
||||
-Lengine -Lengine/.libs \
|
||||
-Lgnc-module -Lgnc-module/.libs \
|
||||
-Lcalculation -Lcalculation/.libs \
|
||||
-Lnetwork-utils -Lnetwork-utils/.libs \
|
||||
-Lapp-utils -Lapp-utils/.libs \
|
||||
gnc-module/libgncmodule.la \
|
||||
gnome-utils/libgncmod-gnome-utils.la \
|
||||
|
@ -42,4 +42,6 @@ app-utils utils for the gnucash app framework (component
|
||||
gnome-utils Extensions and utilities for using Gnome/Gtk
|
||||
with GnuCash, including new widgets.
|
||||
|
||||
network-utils Utils for network communication.
|
||||
|
||||
tax/us US tax information
|
||||
|
@ -13,6 +13,7 @@ CFLAGS = @CFLAGS@ ${GLIB_CFLAGS}
|
||||
INCLUDES = \
|
||||
-I${top_srcdir}/src/gnc-module \
|
||||
-I${top_srcdir}/src/engine \
|
||||
-I${top_srcdir}/src/network-utils \
|
||||
-I${top_srcdir}/src/app-utils \
|
||||
-I${top_srcdir}/src \
|
||||
-I${top_srcdir}/src/gnome \
|
||||
@ -69,6 +70,7 @@ libgncmod_gnome_utils_la_LIBADD = \
|
||||
-L../gnc-module -L../gnc-module/.libs -lgncmodule \
|
||||
-L../engine -L../engine/.libs -lgncmod-engine \
|
||||
-L../calculation -L../calculation/.libs -lgncmod-calculation \
|
||||
-L../network-utils -L../network-utils/.libs -lgncmod-network-utils \
|
||||
-L../app-utils -L../app-utils/.libs -lgncmod-app-utils \
|
||||
${GNOMEUI_LIBS} \
|
||||
${GNOME_LIBDIR} \
|
||||
|
@ -545,17 +545,17 @@ gnc_html_load_to_stream(gnc_html * html, GtkHTMLStream * handle,
|
||||
|
||||
case URL_TYPE_SECURE:
|
||||
if(!https_allowed()) {
|
||||
gnc_error_dialog("Secure HTTP access is disabled.\n"
|
||||
"You can enable it in the Network section of\n"
|
||||
"the Preferences dialog.");
|
||||
gnc_error_dialog(_("Secure HTTP access is disabled.\n"
|
||||
"You can enable it in the Network section of\n"
|
||||
"the Preferences dialog."));
|
||||
break;
|
||||
}
|
||||
|
||||
case URL_TYPE_HTTP:
|
||||
if(!http_allowed()) {
|
||||
gnc_error_dialog("Network HTTP access is disabled.\n"
|
||||
"You can enable it in the Network section of\n"
|
||||
"the Preferences dialog.");
|
||||
gnc_error_dialog(_("Network HTTP access is disabled.\n"
|
||||
"You can enable it in the Network section of\n"
|
||||
"the Preferences dialog."));
|
||||
}
|
||||
else {
|
||||
fullurl = rebuild_url(type, location, label);
|
||||
|
@ -44,6 +44,11 @@ gnc_module_init(int refcount) {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/* load the calculation module (we depend on it) */
|
||||
if(!gnc_module_load("gnucash/network-utils", 0)) {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/* load the calculation module (we depend on it) */
|
||||
if(!gnc_module_load("gnucash/app-utils", 0)) {
|
||||
return FALSE;
|
||||
|
@ -12,6 +12,7 @@ LDADD = \
|
||||
-L${top_srcdir}/src/gnc-module -L${top_srcdir}/src/gnc-module/.libs \
|
||||
-L${top_srcdir}/src/engine -L${top_srcdir}/src/engine/.libs \
|
||||
-L${top_srcdir}/src/calculation -L${top_srcdir}/src/calculation/.libs \
|
||||
-L${top_srcdir}/src/network-utils -L${top_srcdir}/src/network-utils/.libs \
|
||||
-L${top_srcdir}/src/app-utils -L${top_srcdir}/src/app-utils/.libs \
|
||||
${top_srcdir}/src/gnc-module/libgncmodule.la \
|
||||
${top_srcdir}/src/engine/libgncmod-engine.la \
|
||||
|
@ -28,8 +28,6 @@ libgncgnome_a_SOURCES = \
|
||||
druid-stock-split.c \
|
||||
file-history.c \
|
||||
file-utils.c \
|
||||
gnc-gpg.c \
|
||||
gnc-http.c \
|
||||
gnc-network.c \
|
||||
gnc-splash.c \
|
||||
mainwindow-account-tree.c \
|
||||
@ -72,8 +70,6 @@ noinst_HEADERS = \
|
||||
druid-commodity.h \
|
||||
druid-hierarchy.h \
|
||||
file-utils.h \
|
||||
gnc-gpg.h \
|
||||
gnc-http.h \
|
||||
gnc-network.h \
|
||||
gnc-splash.h \
|
||||
mainwindow-account-tree.h \
|
||||
@ -107,6 +103,7 @@ INCLUDES = \
|
||||
-I${top_srcdir}/src \
|
||||
-I${top_srcdir}/src/calculation \
|
||||
-I${top_srcdir}/src/engine \
|
||||
-I${top_srcdir}/src/network-utils \
|
||||
-I${top_srcdir}/src/app-utils \
|
||||
-I${top_srcdir}/src/backend/file \
|
||||
-I${top_srcdir}/src/g-wrap \
|
||||
|
@ -845,7 +845,7 @@ gnc_options_dialog_apply_cb(GNCOptionWin * propertybox,
|
||||
static void
|
||||
gnc_options_dialog_help_cb(GNCOptionWin * propertybox,
|
||||
gpointer user_data) {
|
||||
gnome_ok_dialog("Set the report options you want using this dialog.");
|
||||
gnome_ok_dialog(_("Set the report options you want using this dialog."));
|
||||
}
|
||||
|
||||
static void
|
||||
@ -936,4 +936,3 @@ gnc_report_raise_editor(SCM report) {
|
||||
SCM editor = gh_call1(get_editor, report);
|
||||
gdk_window_raise(GTK_WIDGET(gw_wcp_get_ptr(editor))->window);
|
||||
}
|
||||
|
||||
|
5
src/network-utils/.cvsignore
Normal file
5
src/network-utils/.cvsignore
Normal file
@ -0,0 +1,5 @@
|
||||
Makefile
|
||||
Makefile.in
|
||||
.deps
|
||||
*.diff
|
||||
gnc-dir.h
|
32
src/network-utils/Makefile.am
Normal file
32
src/network-utils/Makefile.am
Normal file
@ -0,0 +1,32 @@
|
||||
SUBDIRS = . test
|
||||
|
||||
pkglib_LTLIBRARIES = libgncmod-network-utils.la
|
||||
|
||||
CFLAGS = @CFLAGS@ \
|
||||
${GLIB_CFLAGS} \
|
||||
${GHTTP_CFLAGS} \
|
||||
${GNOME_INCLUDEDIR}
|
||||
|
||||
INCLUDES = \
|
||||
-I${top_srcdir}/src/gnc-module
|
||||
|
||||
libgncmod_network_utils_la_SOURCES = \
|
||||
gnc-gpg.c \
|
||||
gnc-http.c \
|
||||
gncmod-network-utils.c
|
||||
|
||||
noinst_HEADERS = \
|
||||
gnc-gpg.c \
|
||||
gnc-http.c
|
||||
|
||||
libgncmod_network_utils_la_LDFLAGS = -module
|
||||
|
||||
libgncmod_network_utils_la_LIBADD = \
|
||||
-L../gnc-module -L../gnc-module/.libs -lgncmodule \
|
||||
${GHTTP_LIBS} \
|
||||
${GNOME_LIBDIR} \
|
||||
${GNOME_LIBS} \
|
||||
${GNOMEUI_LIBS}
|
||||
|
||||
EXTRA_DIST = \
|
||||
.cvsignore
|
@ -23,23 +23,15 @@
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include <string.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <gnome.h>
|
||||
#include <unistd.h>
|
||||
#include <glib.h>
|
||||
#include <gnome.h>
|
||||
#include <string.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/types.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include <gtkhtml/gtkhtml.h>
|
||||
#include <gtkhtml/gtkhtml-embedded.h>
|
||||
|
||||
#include "global-options.h"
|
||||
#include "gnc-ui.h"
|
||||
#include "gnc-html.h"
|
||||
#include "gnc-network.h"
|
||||
#include "gnc-gpg.h"
|
||||
|
||||
|
||||
/********************************************************************
|
||||
* gnc_gpg_transform(_async) : call GPG with specified input and args
|
||||
* the _async variety returns immediately and calls a callback when
|
@ -43,7 +43,6 @@
|
||||
#include <string.h>
|
||||
|
||||
#include "gnc-http.h"
|
||||
#include "messages.h"
|
||||
|
||||
|
||||
struct _gnc_http {
|
||||
@ -179,9 +178,9 @@ ghttp_check_callback(gpointer data) {
|
||||
static int
|
||||
gnc_http_certificate_check_cb(ghttp_request * req, X509 * cert,
|
||||
void * user_data) {
|
||||
printf(_("checking SSL certificate..."));
|
||||
printf("checking SSL certificate...");
|
||||
X509_print_fp(stdout, cert);
|
||||
printf(_(" ... done\n"));
|
||||
printf(" ... done\n");
|
||||
return TRUE;
|
||||
}
|
||||
#endif
|
43
src/network-utils/gncmod-network-utils.c
Normal file
43
src/network-utils/gncmod-network-utils.c
Normal file
@ -0,0 +1,43 @@
|
||||
/*********************************************************************
|
||||
* gncmod-netword-utils.c
|
||||
* module definition/initialization for network communication utilities
|
||||
*
|
||||
* Copyright (c) 2001 Linux Developers Group, Inc.
|
||||
*********************************************************************/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <guile/gh.h>
|
||||
#include <glib.h>
|
||||
#include <libguile/strports.h>
|
||||
#include <libguile/modules.h>
|
||||
|
||||
#include "gnc-module.h"
|
||||
#include "gnc-module-api.h"
|
||||
|
||||
/* version of the gnc module system interface we require */
|
||||
int gnc_module_system_interface = 0;
|
||||
|
||||
/* module versioning uses libtool semantics. */
|
||||
int gnc_module_current = 0;
|
||||
int gnc_module_revision = 0;
|
||||
int gnc_module_age = 0;
|
||||
|
||||
char *
|
||||
gnc_module_path(void) {
|
||||
return g_strdup("gnucash/network-utils");
|
||||
}
|
||||
|
||||
char *
|
||||
gnc_module_description(void) {
|
||||
return g_strdup("Utilities for performing network communication");
|
||||
}
|
||||
|
||||
int
|
||||
gnc_module_init(int refcount) {
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
int
|
||||
gnc_module_end(int refcount) {
|
||||
return TRUE;
|
||||
}
|
5
src/network-utils/test/.cvsignore
Normal file
5
src/network-utils/test/.cvsignore
Normal file
@ -0,0 +1,5 @@
|
||||
Makefile
|
||||
Makefile.in
|
||||
.deps
|
||||
.libs
|
||||
test-link-module
|
26
src/network-utils/test/Makefile.am
Normal file
26
src/network-utils/test/Makefile.am
Normal file
@ -0,0 +1,26 @@
|
||||
TESTS = \
|
||||
test-link-module
|
||||
# test-load-module
|
||||
|
||||
TESTS_ENVIRONMENT= \
|
||||
GNC_MODULE_PATH=../../gnc-module:.. \
|
||||
GUILE_LOAD_PATH=${G_WRAP_MODULE_DIR}:..:../../gnc-module:${top_srcdir}/lib \
|
||||
LTDL_LIBRARY_PATH=.. \
|
||||
LD_LIBRARY_PATH=${top_srcdir}/src/gnc-module:${top_srcdir}/src/gnc-module/.libs
|
||||
|
||||
LDADD = \
|
||||
-L${top_srcdir}/src/gnc-module -L${top_srcdir}/src/gnc-module/.libs \
|
||||
${top_srcdir}/src/gnc-module/libgncmodule.la \
|
||||
../libgncmod-network-utils.la \
|
||||
-lltdl
|
||||
|
||||
bin_PROGRAMS = \
|
||||
test-link-module
|
||||
|
||||
#EXTRA_DIST = test-load-module
|
||||
|
||||
INCLUDES = \
|
||||
-I${top_srcdir}/src/test-core \
|
||||
-I..
|
||||
|
||||
CFLAGS = @CFLAGS@ ${GLIB_CFLAGS}
|
6
src/network-utils/test/test-link-module.c
Normal file
6
src/network-utils/test/test-link-module.c
Normal file
@ -0,0 +1,6 @@
|
||||
#include <stdlib.h>
|
||||
|
||||
int
|
||||
main(int argc, char ** argv) {
|
||||
exit(0);
|
||||
}
|
Loading…
Reference in New Issue
Block a user