/* * This file is part of NetSurf, http://netsurf.sourceforge.net/ * Licensed under the GNU General Public License, * http://www.opensource.org/licenses/gpl-license * Copyright 2004 John M Bell */ #include #include /* for __riscosify */ #include /* possibly just have accessor methods in utils.c */ #include "oslib/osfile.h" #include "netsurf/utils/config.h" #include "netsurf/content/content.h" #include "netsurf/css/css.h" #include "netsurf/render/form.h" #include "netsurf/render/layout.h" #include "netsurf/riscos/save_complete.h" #include "netsurf/utils/log.h" #include "netsurf/utils/utils.h" #ifdef WITH_SAVE_COMPLETE /** \todo URL rewriting * Objects used by embedded html pages * GUI */ void save_imported_sheets(struct content *c, int parent, int level, char *p, char* fn); char* get_filename(char * url); /* this is temporary. */ const char * const SAVE_PATH = ".savetest."; const char * const OBJ_DIR = "_files"; /** \todo this will probably want to take a filename */ void save_complete(struct content *c) { char *fname = 0, *spath; unsigned int i; if (c->type != CONTENT_HTML) { return; } fname = get_filename(c->data.html.base_url); if (!fname) { /* no path -> exit */ return; } spath = xcalloc(strlen(SAVE_PATH)+strlen(OBJ_DIR)+strlen(fname)+50, sizeof(char)); sprintf(spath, "%s%s%s", SAVE_PATH, fname, OBJ_DIR); xosfile_create_dir(spath, 77); /* save stylesheets, ignoring the base sheet and