netsurf: branch master updated. release/3.3-49-g6b7d724
by NetSurf Browser Project
Gitweb links:
...log http://git.netsurf-browser.org/netsurf.git/shortlog/6b7d724311bb785b0893f...
...commit http://git.netsurf-browser.org/netsurf.git/commit/6b7d724311bb785b0893f1d...
...tree http://git.netsurf-browser.org/netsurf.git/tree/6b7d724311bb785b0893f1db9...
The branch, master has been updated
via 6b7d724311bb785b0893f1db900db9e9595bd176 (commit)
via 694baf4bc7f7871b49b0a2f823554f73d2f1bfb7 (commit)
via 5142d59d412a191e97b6c683c135f8593e40345d (commit)
via fa6fed166df85eece10d67f79f39fa0b94893518 (commit)
via 748efc0c40c7067651c92091155dd020bf3cfff4 (commit)
via 05c742df09825079be2d21b8e52726f68cc5343c (commit)
from d3c4eb73631b0f3fb5b08400592f438f0cf71f79 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=6b7d724311bb785b089...
commit 6b7d724311bb785b0893f1db900db9e9595bd176
Author: Vincent Sanders <vince(a)kyllikki.org>
Commit: Vincent Sanders <vince(a)kyllikki.org>
update beos meakfile to filter split messages
diff --git a/beos/Makefile.target b/beos/Makefile.target
index bab6429..8b41a96 100644
--- a/beos/Makefile.target
+++ b/beos/Makefile.target
@@ -121,6 +121,9 @@ RDEP_BEOS := $(addprefix beos/res/,$(RDEP_BEOS)) \
SOURCES = $(S_COMMON) $(S_IMAGE) $(S_BROWSER) $(S_BEOS)
EXETARGET := NetSurf
+# The filter and target for split messages
+MESSAGES_FILTER=beos
+
# ----------------------------------------------------------------------------
# Resources
# ----------------------------------------------------------------------------
@@ -153,7 +156,6 @@ install-beos:
@cp -vRL beos/res/beosdefault.css $(DESTDIR)$(NETSURF_BEOS_RESOURCES)
@cp -vRL gtk/res/license $(DESTDIR)$(NETSURF_BEOS_RESOURCES)
# @cp -vRL beos/res/throbber/*.png $(DESTDIR)$(NETSURF_BEOS_RESOURCES)throbber
- $(call split_install_messages, beos, $(DESTDIR)$(NETSURF_BEOS_RESOURCES))
# ----------------------------------------------------------------------------
# Package target
commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=694baf4bc7f7871b49b...
commit 694baf4bc7f7871b49b0a2f823554f73d2f1bfb7
Author: Vincent Sanders <vince(a)kyllikki.org>
Commit: Vincent Sanders <vince(a)kyllikki.org>
Update amiga makefile to set filter for split messages
diff --git a/amiga/Makefile.target b/amiga/Makefile.target
index bca0c30..9c7b8f5 100644
--- a/amiga/Makefile.target
+++ b/amiga/Makefile.target
@@ -61,6 +61,9 @@ endif
EXETARGET := NetSurf
+# The filter and target for split messages
+MESSAGES_FILTER=ami
+
# ----------------------------------------------------------------------------
# Source file setup
# ----------------------------------------------------------------------------
@@ -116,7 +119,6 @@ netsurf.lha: $(EXETARGET)
$(Q)cp \!NetSurf/Resources/netsurf.png,b60 $(AMIGA_INSTALL_TARGET_DIR)/NetSurf/Resources/netsurf.png
$(Q)cp amiga/pkg/drawer.info $(AMIGA_INSTALL_TARGET_DIR)/NetSurf.info
$(Q)cp amiga/pkg/AutoInstall $(AMIGA_INSTALL_TARGET_DIR)
- $(call split_install_messages, ami, $(AMIGA_INSTALL_TARGET_DIR)/NetSurf/Resources/)
$(Q)cd $(AMIGA_INSTALL_TARGET_DIR); \
lha a netsurf.lha NetSurf NetSurf.info AutoInstall
commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=5142d59d412a191e97b...
commit 5142d59d412a191e97b6c683c135f8593e40345d
Author: Vincent Sanders <vince(a)kyllikki.org>
Commit: Vincent Sanders <vince(a)kyllikki.org>
Update RISC OS make target to filter split messages
diff --git a/riscos/Makefile.target b/riscos/Makefile.target
index e40795c..de848cf 100644
--- a/riscos/Makefile.target
+++ b/riscos/Makefile.target
@@ -36,7 +36,7 @@ $(eval $(call pkg_config_find_and_add_enabled,JS,mozilla-js,JavaScript))
TPD_RISCOS = $(foreach TPL,$(notdir $(TPL_RISCOS)), \
!NetSurf/Resources/$(TPL)/Templates$(TPLEXT))
-RESOURCES = $(TPD_RISCOS) split-messages
+RESOURCES = $(TPD_RISCOS)
CFLAGS += -Driscos -std=c99 -D_BSD_SOURCE -D_POSIX_C_SOURCE \
-mpoke-function-name -fno-strict-aliasing
@@ -89,6 +89,9 @@ SOURCES = $(S_COMMON) $(S_IMAGE) $(S_BROWSER) $(S_RISCOS)
EXETARGET := !NetSurf/!RunImage$(EXEEXT)
+# The filter and target for split messages
+MESSAGES_FILTER=ro
+
!NetSurf/!Run$(RUNEXT): riscos/scripts/Run $(EXETARGET)
$(VQ)echo " MAKERUN: $@"
$(Q)$(MAKERUN) $(EXETARGET) $< $@
@@ -115,10 +118,6 @@ clean-help:
CLEANS += clean-run clean-help
-split-messages:
- $(call split_install_messages, ro, !NetSurf/Resources/)
-.PHONY: split-messages
-
# ----------------------------------------------------------------------------
# Template targets
# ----------------------------------------------------------------------------
@@ -127,6 +126,7 @@ split-messages:
TPL_RISCOS := de en fr nl # TODO: It'd be nice to auto-detect these
TPL_RISCOS := $(addprefix riscos/templates/,$(TPL_RISCOS))
+# Template target creation macro
define compile_template
!NetSurf/Resources/$(1)/Templates$$(TPLEXT): $(2)
$$(VQ)echo "TEMPLATE: $(2)"
commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=fa6fed166df85eece10...
commit fa6fed166df85eece10d67f79f39fa0b94893518
Author: Vincent Sanders <vince(a)kyllikki.org>
Commit: Vincent Sanders <vince(a)kyllikki.org>
squash
diff --git a/gtk/Makefile.target b/gtk/Makefile.target
index 480f04c..23c0145 100644
--- a/gtk/Makefile.target
+++ b/gtk/Makefile.target
@@ -156,7 +156,6 @@ install-gtk:
$(Q)install -m 0644 gtk/res/throbber/*.png $(DESTDIR)$(NETSURF_GTK_RESOURCES)/throbber
$(Q)tar -c -h -C gtk/res -f - themes | tar -xv -C $(DESTDIR)$(NETSURF_GTK_RESOURCES) -f -
$(Q)tar -c -h -C gtk/res -f - $(GTK_TRANSLATIONS_HTML) | tar -xv -C $(DESTDIR)$(NETSURF_GTK_RESOURCES) -f -
- $(call split_install_messages, gtk, $(DESTDIR)$(NETSURF_GTK_RESOURCES))
$(Q)install -m 0644 $(GTK_RESOURCES_LIST) $(DESTDIR)$(NETSURF_GTK_RESOURCES)
# ----------------------------------------------------------------------------
commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=748efc0c40c7067651c...
commit 748efc0c40c7067651c92091155dd020bf3cfff4
Author: Vincent Sanders <vince(a)kyllikki.org>
Commit: Vincent Sanders <vince(a)kyllikki.org>
Improve split message generation
Changes the way message files are generated to be driven by make as
rules rather than from explicit macro calls causing their regeneration
every build.
A secondary benefit is that errors in message generation actually stop
the build instead of being ignored
Each frontend will require its filter settings updated to avoid
getting the default message filter of "any". Initially gtk has been
adapted as proof of concept.
diff --git a/.gitignore b/.gitignore
index 43881bd..4102f3e 100644
--- a/.gitignore
+++ b/.gitignore
@@ -13,6 +13,11 @@ windows/res/preferences
\!NetSurf/Resources/nl/Templates,fec
\!NetSurf/Resources/nl/Messages
\!NetSurf/Resources/it/Messages
+gtk/res/en/Messages
+gtk/res/fr/Messages
+gtk/res/de/Messages
+gtk/res/nl/Messages
+gtk/res/it/Messages
test/nsoption
test/nsurl
test/urldbtest
diff --git a/Makefile b/Makefile
index d54bfd4..549bfb5 100644
--- a/Makefile
+++ b/Makefile
@@ -122,9 +122,23 @@ ifeq ($(filter $(VLDTARGET),$(TARGET)),)
$(error Unknown TARGET "$(TARGET)", Must be one of $(VLDTARGET))
endif
-SUBTARGET =
-RESOURCES =
-
+# ensure empty values for base variables
+
+# Sub target for build
+SUBTARGET=
+# Resources executable target depends upon
+RESOURCES=
+# Messages executable target depends on
+MESSAGES:=
+
+# The filter applied to the fat (full) messages to generate split messages
+MESSAGES_FILTER=any
+# The languages in the fat messages to convert
+MESSAGES_LANGUAGES=de en fr it nl
+# The target directory for the split messages
+MESSAGES_TARGET=!NetSurf/Resources
+
+# Defaults for tools
PERL=perl
MKDIR=mkdir
TOUCH=touch
@@ -521,8 +535,7 @@ $(TOOLROOT)/created: $(OBJROOT)/created
$(Q)$(MKDIR) $(TOOLROOT)
$(Q)$(TOUCH) $(TOOLROOT)/created
-CLEANS := clean-target clean-testament
-
+CLEANS :=
POSTEXES :=
# ----------------------------------------------------------------------------
@@ -568,6 +581,39 @@ S_COMMON := $(S_CONTENT) $(S_FETCHERS) $(S_CSS) $(S_RENDER) $(S_UTILS) \
# ----------------------------------------------------------------------------
+# Message targets
+# ----------------------------------------------------------------------------
+
+# Message splitting rule generation macro
+# 1 = Language
+define split_messages
+.INTERMEDIATE:$$(MESSAGES_TARGET)/$(1)/Messages.tmp
+
+$$(MESSAGES_TARGET)/$(1)/Messages.tmp: resources/FatMessages
+ $$(VQ)echo "MSGSPLIT: Language: $(1) Filter: $$(MESSAGES_FILTER)"
+ $$(Q)mkdir -p $$(MESSAGES_TARGET)/$(1)
+ $$(Q)$$(SPLIT_MESSAGES) -l $(1) -p $$(MESSAGES_FILTER) -f messages -o $$@ $$<
+
+$$(MESSAGES_TARGET)/$(1)/Messages: $$(MESSAGES_TARGET)/$(1)/Messages.tmp
+ $$(VQ)echo "COMPRESS: $$@"
+ $$(VQ)gzip -9n < $$< > $$@
+
+CLEAN_MESSAGES += $$(MESSAGES_TARGET)/$(1)/Messages
+MESSAGES += $$(MESSAGES_TARGET)/$(1)/Messages
+
+endef
+
+# geenrate the message file rules
+$(eval $(foreach LANG,$(MESSAGES_LANGUAGES), \
+ $(call split_messages,$(LANG))))
+
+clean-messages:
+ $(VQ)echo " CLEAN: $(CLEAN_MESSAGES)"
+ $(Q)$(RM) $(CLEAN_MESSAGES)
+CLEANS += clean-messages
+
+
+# ----------------------------------------------------------------------------
# Source file setup
# ----------------------------------------------------------------------------
@@ -580,7 +626,7 @@ endif
OBJECTS := $(sort $(addprefix $(OBJROOT)/,$(subst /,_,$(patsubst %.c,%.o,$(patsubst %.cpp,%.o,$(patsubst %.m,%.o,$(patsubst %.s,%.o,$(SOURCES))))))))
-$(EXETARGET): $(OBJECTS) $(RESOURCES)
+$(EXETARGET): $(OBJECTS) $(RESOURCES) $(MESSAGES)
$(VQ)echo " LINK: $(EXETARGET)"
ifneq ($(TARGET)$(SUBTARGET),riscos-elf)
$(Q)$(CC) -o $(EXETARGET) $(OBJECTS) $(LDFLAGS)
@@ -615,11 +661,12 @@ endif
clean-target:
$(VQ)echo " CLEAN: $(EXETARGET)"
$(Q)$(RM) $(EXETARGET)
- $(call clean_install_messages, !NetSurf/Resources)
+CLEANS += clean-target
clean-testament:
$(VQ)echo " CLEAN: testament.h"
$(Q)$(RM) $(OBJROOT)/testament.h
+CLEANS += clean-testament
clean-builddir:
$(VQ)echo " CLEAN: $(OBJROOT)"
@@ -627,15 +674,12 @@ clean-builddir:
CLEANS += clean-builddir
-.PHONY: all-program all-messages testament
+.PHONY: all-program testament
testament $(OBJROOT)/testament.h:
$(Q)$(PERL) utils/git-testament.pl $(CURDIR) $(OBJROOT)/testament.h
-all-messages:
- $(call split_install_messages, any, !NetSurf/Resources)
-
-all-program: all-messages $(EXETARGET) $(POSTEXES)
+all-program: $(EXETARGET) $(POSTEXES)
.SUFFIXES:
@@ -758,25 +802,6 @@ clean: $(CLEANS)
# Target builds a distribution package
package: all-program package-$(TARGET)
-FAT_LANGUAGES=de en fr it nl
-# 1 = front end name (gtk, ro, ami, etc)
-# 2 = Destination directory (where resources being installed, creates en/Messages etc)
-# 3 = suffix after language name
-define split_install_messages
- $(foreach LANG, $(FAT_LANGUAGES), @echo MSGSPLIT: $(1)/$(LANG) to $(2)
- $(Q)mkdir -p $(2)/$(LANG)$(3)
- $(Q)$(SPLIT_MESSAGES) -l $(LANG) -p $(1) -f messages resources/FatMessages | gzip -9n > $(2)$(3)/$(LANG)/Messages
- )
-endef
-
-# Clean Message target
-# 1 = Destination directory (where resources being installed, creates en/Messages etc)
-# 2 = suffix after language name
-define clean_install_messages
- $(foreach LANG, $(FAT_LANGUAGES), @echo MSGCLEAN: $(LANG) in $(1)
- $(Q)$(RM) -f $(1)$(2)/$(LANG)/Messages
- )
-endef
.PHONY: messages-split-tfx messages-fetch-tfx messages-import-tfx
diff --git a/gtk/Makefile.target b/gtk/Makefile.target
index e69f6c2..480f04c 100644
--- a/gtk/Makefile.target
+++ b/gtk/Makefile.target
@@ -121,8 +121,14 @@ S_GTK := $(addprefix gtk/,$(S_GTK)) $(addprefix utils/,container.c)
# Note this is deliberately *not* expanded here as common and image
# are not yet available
SOURCES = $(S_COMMON) $(S_IMAGE) $(S_BROWSER) $(S_PIXBUF) $(S_GTK)
+
+# The gtk binary target
EXETARGET := nsgtk
+# The filter and target for split messages
+MESSAGES_FILTER=gtk
+MESSAGES_TARGET=gtk/res
+
# ----------------------------------------------------------------------------
# Install target
# ----------------------------------------------------------------------------
diff --git a/gtk/res/de/Messages b/gtk/res/de/Messages
deleted file mode 120000
index 2f1fc39..0000000
--- a/gtk/res/de/Messages
+++ /dev/null
@@ -1 +0,0 @@
-../../../!NetSurf/Resources/de/Messages
\ No newline at end of file
diff --git a/gtk/res/en/Messages b/gtk/res/en/Messages
deleted file mode 120000
index 72c9eff..0000000
--- a/gtk/res/en/Messages
+++ /dev/null
@@ -1 +0,0 @@
-../../../!NetSurf/Resources/en/Messages
\ No newline at end of file
diff --git a/gtk/res/fr/Messages b/gtk/res/fr/Messages
deleted file mode 120000
index a42cf08..0000000
--- a/gtk/res/fr/Messages
+++ /dev/null
@@ -1 +0,0 @@
-../../../!NetSurf/Resources/fr/Messages
\ No newline at end of file
diff --git a/gtk/res/it/Messages b/gtk/res/it/Messages
deleted file mode 120000
index d4c5c29..0000000
--- a/gtk/res/it/Messages
+++ /dev/null
@@ -1 +0,0 @@
-../../../!NetSurf/Resources/it/Messages
\ No newline at end of file
diff --git a/gtk/res/nl/Messages b/gtk/res/nl/Messages
deleted file mode 120000
index d484ebd..0000000
--- a/gtk/res/nl/Messages
+++ /dev/null
@@ -1 +0,0 @@
-../../../!NetSurf/Resources/nl/Messages
\ No newline at end of file
commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=05c742df09825079be2...
commit 05c742df09825079be2d21b8e52726f68cc5343c
Author: Vincent Sanders <vince(a)kyllikki.org>
Commit: Vincent Sanders <vince(a)kyllikki.org>
Improve the make target validation
diff --git a/Makefile b/Makefile
index 3321086..d54bfd4 100644
--- a/Makefile
+++ b/Makefile
@@ -114,29 +114,17 @@ ifeq ($(TARGET),)
TARGET := gtk
endif
-SUBTARGET =
-RESOURCES =
+# valid values for the TARGET
+VLDTARGET := riscos gtk beos amiga amigaos3 framebuffer windows atari cocoa monkey
-ifneq ($(TARGET),riscos)
- ifneq ($(TARGET),gtk)
- ifneq ($(TARGET),beos)
- ifneq ($(findstring amiga,$(TARGET)),amiga)
- ifneq ($(TARGET),framebuffer)
- ifneq ($(TARGET),windows)
- ifneq ($(TARGET),atari)
- ifneq ($(TARGET),cocoa)
- ifneq ($(TARGET),monkey)
- $(error Unknown TARGET "$(TARGET)", should either be "riscos", "gtk", "beos", "amiga", "framebuffer", "windows", "atari" or "cocoa" or "monkey")
- endif
- endif
- endif
- endif
- endif
- endif
- endif
- endif
+# Check for valid TARGET
+ifeq ($(filter $(VLDTARGET),$(TARGET)),)
+ $(error Unknown TARGET "$(TARGET)", Must be one of $(VLDTARGET))
endif
+SUBTARGET =
+RESOURCES =
+
PERL=perl
MKDIR=mkdir
TOUCH=touch
-----------------------------------------------------------------------
Summary of changes:
.gitignore | 5 +++
Makefile | 111 +++++++++++++++++++++++++++---------------------
amiga/Makefile.target | 4 +-
beos/Makefile.target | 4 +-
gtk/Makefile.target | 7 ++-
gtk/res/de/Messages | 1 -
gtk/res/en/Messages | 1 -
gtk/res/fr/Messages | 1 -
gtk/res/it/Messages | 1 -
gtk/res/nl/Messages | 1 -
riscos/Makefile.target | 10 ++---
11 files changed, 84 insertions(+), 62 deletions(-)
delete mode 120000 gtk/res/de/Messages
delete mode 120000 gtk/res/en/Messages
delete mode 120000 gtk/res/fr/Messages
delete mode 120000 gtk/res/it/Messages
delete mode 120000 gtk/res/nl/Messages
diff --git a/.gitignore b/.gitignore
index 43881bd..4102f3e 100644
--- a/.gitignore
+++ b/.gitignore
@@ -13,6 +13,11 @@ windows/res/preferences
\!NetSurf/Resources/nl/Templates,fec
\!NetSurf/Resources/nl/Messages
\!NetSurf/Resources/it/Messages
+gtk/res/en/Messages
+gtk/res/fr/Messages
+gtk/res/de/Messages
+gtk/res/nl/Messages
+gtk/res/it/Messages
test/nsoption
test/nsurl
test/urldbtest
diff --git a/Makefile b/Makefile
index 3321086..549bfb5 100644
--- a/Makefile
+++ b/Makefile
@@ -114,29 +114,31 @@ ifeq ($(TARGET),)
TARGET := gtk
endif
-SUBTARGET =
-RESOURCES =
-
-ifneq ($(TARGET),riscos)
- ifneq ($(TARGET),gtk)
- ifneq ($(TARGET),beos)
- ifneq ($(findstring amiga,$(TARGET)),amiga)
- ifneq ($(TARGET),framebuffer)
- ifneq ($(TARGET),windows)
- ifneq ($(TARGET),atari)
- ifneq ($(TARGET),cocoa)
- ifneq ($(TARGET),monkey)
- $(error Unknown TARGET "$(TARGET)", should either be "riscos", "gtk", "beos", "amiga", "framebuffer", "windows", "atari" or "cocoa" or "monkey")
- endif
- endif
- endif
- endif
- endif
- endif
- endif
- endif
+# valid values for the TARGET
+VLDTARGET := riscos gtk beos amiga amigaos3 framebuffer windows atari cocoa monkey
+
+# Check for valid TARGET
+ifeq ($(filter $(VLDTARGET),$(TARGET)),)
+ $(error Unknown TARGET "$(TARGET)", Must be one of $(VLDTARGET))
endif
+# ensure empty values for base variables
+
+# Sub target for build
+SUBTARGET=
+# Resources executable target depends upon
+RESOURCES=
+# Messages executable target depends on
+MESSAGES:=
+
+# The filter applied to the fat (full) messages to generate split messages
+MESSAGES_FILTER=any
+# The languages in the fat messages to convert
+MESSAGES_LANGUAGES=de en fr it nl
+# The target directory for the split messages
+MESSAGES_TARGET=!NetSurf/Resources
+
+# Defaults for tools
PERL=perl
MKDIR=mkdir
TOUCH=touch
@@ -533,8 +535,7 @@ $(TOOLROOT)/created: $(OBJROOT)/created
$(Q)$(MKDIR) $(TOOLROOT)
$(Q)$(TOUCH) $(TOOLROOT)/created
-CLEANS := clean-target clean-testament
-
+CLEANS :=
POSTEXES :=
# ----------------------------------------------------------------------------
@@ -580,6 +581,39 @@ S_COMMON := $(S_CONTENT) $(S_FETCHERS) $(S_CSS) $(S_RENDER) $(S_UTILS) \
# ----------------------------------------------------------------------------
+# Message targets
+# ----------------------------------------------------------------------------
+
+# Message splitting rule generation macro
+# 1 = Language
+define split_messages
+.INTERMEDIATE:$$(MESSAGES_TARGET)/$(1)/Messages.tmp
+
+$$(MESSAGES_TARGET)/$(1)/Messages.tmp: resources/FatMessages
+ $$(VQ)echo "MSGSPLIT: Language: $(1) Filter: $$(MESSAGES_FILTER)"
+ $$(Q)mkdir -p $$(MESSAGES_TARGET)/$(1)
+ $$(Q)$$(SPLIT_MESSAGES) -l $(1) -p $$(MESSAGES_FILTER) -f messages -o $$@ $$<
+
+$$(MESSAGES_TARGET)/$(1)/Messages: $$(MESSAGES_TARGET)/$(1)/Messages.tmp
+ $$(VQ)echo "COMPRESS: $$@"
+ $$(VQ)gzip -9n < $$< > $$@
+
+CLEAN_MESSAGES += $$(MESSAGES_TARGET)/$(1)/Messages
+MESSAGES += $$(MESSAGES_TARGET)/$(1)/Messages
+
+endef
+
+# geenrate the message file rules
+$(eval $(foreach LANG,$(MESSAGES_LANGUAGES), \
+ $(call split_messages,$(LANG))))
+
+clean-messages:
+ $(VQ)echo " CLEAN: $(CLEAN_MESSAGES)"
+ $(Q)$(RM) $(CLEAN_MESSAGES)
+CLEANS += clean-messages
+
+
+# ----------------------------------------------------------------------------
# Source file setup
# ----------------------------------------------------------------------------
@@ -592,7 +626,7 @@ endif
OBJECTS := $(sort $(addprefix $(OBJROOT)/,$(subst /,_,$(patsubst %.c,%.o,$(patsubst %.cpp,%.o,$(patsubst %.m,%.o,$(patsubst %.s,%.o,$(SOURCES))))))))
-$(EXETARGET): $(OBJECTS) $(RESOURCES)
+$(EXETARGET): $(OBJECTS) $(RESOURCES) $(MESSAGES)
$(VQ)echo " LINK: $(EXETARGET)"
ifneq ($(TARGET)$(SUBTARGET),riscos-elf)
$(Q)$(CC) -o $(EXETARGET) $(OBJECTS) $(LDFLAGS)
@@ -627,11 +661,12 @@ endif
clean-target:
$(VQ)echo " CLEAN: $(EXETARGET)"
$(Q)$(RM) $(EXETARGET)
- $(call clean_install_messages, !NetSurf/Resources)
+CLEANS += clean-target
clean-testament:
$(VQ)echo " CLEAN: testament.h"
$(Q)$(RM) $(OBJROOT)/testament.h
+CLEANS += clean-testament
clean-builddir:
$(VQ)echo " CLEAN: $(OBJROOT)"
@@ -639,15 +674,12 @@ clean-builddir:
CLEANS += clean-builddir
-.PHONY: all-program all-messages testament
+.PHONY: all-program testament
testament $(OBJROOT)/testament.h:
$(Q)$(PERL) utils/git-testament.pl $(CURDIR) $(OBJROOT)/testament.h
-all-messages:
- $(call split_install_messages, any, !NetSurf/Resources)
-
-all-program: all-messages $(EXETARGET) $(POSTEXES)
+all-program: $(EXETARGET) $(POSTEXES)
.SUFFIXES:
@@ -770,25 +802,6 @@ clean: $(CLEANS)
# Target builds a distribution package
package: all-program package-$(TARGET)
-FAT_LANGUAGES=de en fr it nl
-# 1 = front end name (gtk, ro, ami, etc)
-# 2 = Destination directory (where resources being installed, creates en/Messages etc)
-# 3 = suffix after language name
-define split_install_messages
- $(foreach LANG, $(FAT_LANGUAGES), @echo MSGSPLIT: $(1)/$(LANG) to $(2)
- $(Q)mkdir -p $(2)/$(LANG)$(3)
- $(Q)$(SPLIT_MESSAGES) -l $(LANG) -p $(1) -f messages resources/FatMessages | gzip -9n > $(2)$(3)/$(LANG)/Messages
- )
-endef
-
-# Clean Message target
-# 1 = Destination directory (where resources being installed, creates en/Messages etc)
-# 2 = suffix after language name
-define clean_install_messages
- $(foreach LANG, $(FAT_LANGUAGES), @echo MSGCLEAN: $(LANG) in $(1)
- $(Q)$(RM) -f $(1)$(2)/$(LANG)/Messages
- )
-endef
.PHONY: messages-split-tfx messages-fetch-tfx messages-import-tfx
diff --git a/amiga/Makefile.target b/amiga/Makefile.target
index bca0c30..9c7b8f5 100644
--- a/amiga/Makefile.target
+++ b/amiga/Makefile.target
@@ -61,6 +61,9 @@ endif
EXETARGET := NetSurf
+# The filter and target for split messages
+MESSAGES_FILTER=ami
+
# ----------------------------------------------------------------------------
# Source file setup
# ----------------------------------------------------------------------------
@@ -116,7 +119,6 @@ netsurf.lha: $(EXETARGET)
$(Q)cp \!NetSurf/Resources/netsurf.png,b60 $(AMIGA_INSTALL_TARGET_DIR)/NetSurf/Resources/netsurf.png
$(Q)cp amiga/pkg/drawer.info $(AMIGA_INSTALL_TARGET_DIR)/NetSurf.info
$(Q)cp amiga/pkg/AutoInstall $(AMIGA_INSTALL_TARGET_DIR)
- $(call split_install_messages, ami, $(AMIGA_INSTALL_TARGET_DIR)/NetSurf/Resources/)
$(Q)cd $(AMIGA_INSTALL_TARGET_DIR); \
lha a netsurf.lha NetSurf NetSurf.info AutoInstall
diff --git a/beos/Makefile.target b/beos/Makefile.target
index bab6429..8b41a96 100644
--- a/beos/Makefile.target
+++ b/beos/Makefile.target
@@ -121,6 +121,9 @@ RDEP_BEOS := $(addprefix beos/res/,$(RDEP_BEOS)) \
SOURCES = $(S_COMMON) $(S_IMAGE) $(S_BROWSER) $(S_BEOS)
EXETARGET := NetSurf
+# The filter and target for split messages
+MESSAGES_FILTER=beos
+
# ----------------------------------------------------------------------------
# Resources
# ----------------------------------------------------------------------------
@@ -153,7 +156,6 @@ install-beos:
@cp -vRL beos/res/beosdefault.css $(DESTDIR)$(NETSURF_BEOS_RESOURCES)
@cp -vRL gtk/res/license $(DESTDIR)$(NETSURF_BEOS_RESOURCES)
# @cp -vRL beos/res/throbber/*.png $(DESTDIR)$(NETSURF_BEOS_RESOURCES)throbber
- $(call split_install_messages, beos, $(DESTDIR)$(NETSURF_BEOS_RESOURCES))
# ----------------------------------------------------------------------------
# Package target
diff --git a/gtk/Makefile.target b/gtk/Makefile.target
index e69f6c2..23c0145 100644
--- a/gtk/Makefile.target
+++ b/gtk/Makefile.target
@@ -121,8 +121,14 @@ S_GTK := $(addprefix gtk/,$(S_GTK)) $(addprefix utils/,container.c)
# Note this is deliberately *not* expanded here as common and image
# are not yet available
SOURCES = $(S_COMMON) $(S_IMAGE) $(S_BROWSER) $(S_PIXBUF) $(S_GTK)
+
+# The gtk binary target
EXETARGET := nsgtk
+# The filter and target for split messages
+MESSAGES_FILTER=gtk
+MESSAGES_TARGET=gtk/res
+
# ----------------------------------------------------------------------------
# Install target
# ----------------------------------------------------------------------------
@@ -150,7 +156,6 @@ install-gtk:
$(Q)install -m 0644 gtk/res/throbber/*.png $(DESTDIR)$(NETSURF_GTK_RESOURCES)/throbber
$(Q)tar -c -h -C gtk/res -f - themes | tar -xv -C $(DESTDIR)$(NETSURF_GTK_RESOURCES) -f -
$(Q)tar -c -h -C gtk/res -f - $(GTK_TRANSLATIONS_HTML) | tar -xv -C $(DESTDIR)$(NETSURF_GTK_RESOURCES) -f -
- $(call split_install_messages, gtk, $(DESTDIR)$(NETSURF_GTK_RESOURCES))
$(Q)install -m 0644 $(GTK_RESOURCES_LIST) $(DESTDIR)$(NETSURF_GTK_RESOURCES)
# ----------------------------------------------------------------------------
diff --git a/gtk/res/de/Messages b/gtk/res/de/Messages
deleted file mode 120000
index 2f1fc39..0000000
--- a/gtk/res/de/Messages
+++ /dev/null
@@ -1 +0,0 @@
-../../../!NetSurf/Resources/de/Messages
\ No newline at end of file
diff --git a/gtk/res/en/Messages b/gtk/res/en/Messages
deleted file mode 120000
index 72c9eff..0000000
--- a/gtk/res/en/Messages
+++ /dev/null
@@ -1 +0,0 @@
-../../../!NetSurf/Resources/en/Messages
\ No newline at end of file
diff --git a/gtk/res/fr/Messages b/gtk/res/fr/Messages
deleted file mode 120000
index a42cf08..0000000
--- a/gtk/res/fr/Messages
+++ /dev/null
@@ -1 +0,0 @@
-../../../!NetSurf/Resources/fr/Messages
\ No newline at end of file
diff --git a/gtk/res/it/Messages b/gtk/res/it/Messages
deleted file mode 120000
index d4c5c29..0000000
--- a/gtk/res/it/Messages
+++ /dev/null
@@ -1 +0,0 @@
-../../../!NetSurf/Resources/it/Messages
\ No newline at end of file
diff --git a/gtk/res/nl/Messages b/gtk/res/nl/Messages
deleted file mode 120000
index d484ebd..0000000
--- a/gtk/res/nl/Messages
+++ /dev/null
@@ -1 +0,0 @@
-../../../!NetSurf/Resources/nl/Messages
\ No newline at end of file
diff --git a/riscos/Makefile.target b/riscos/Makefile.target
index e40795c..de848cf 100644
--- a/riscos/Makefile.target
+++ b/riscos/Makefile.target
@@ -36,7 +36,7 @@ $(eval $(call pkg_config_find_and_add_enabled,JS,mozilla-js,JavaScript))
TPD_RISCOS = $(foreach TPL,$(notdir $(TPL_RISCOS)), \
!NetSurf/Resources/$(TPL)/Templates$(TPLEXT))
-RESOURCES = $(TPD_RISCOS) split-messages
+RESOURCES = $(TPD_RISCOS)
CFLAGS += -Driscos -std=c99 -D_BSD_SOURCE -D_POSIX_C_SOURCE \
-mpoke-function-name -fno-strict-aliasing
@@ -89,6 +89,9 @@ SOURCES = $(S_COMMON) $(S_IMAGE) $(S_BROWSER) $(S_RISCOS)
EXETARGET := !NetSurf/!RunImage$(EXEEXT)
+# The filter and target for split messages
+MESSAGES_FILTER=ro
+
!NetSurf/!Run$(RUNEXT): riscos/scripts/Run $(EXETARGET)
$(VQ)echo " MAKERUN: $@"
$(Q)$(MAKERUN) $(EXETARGET) $< $@
@@ -115,10 +118,6 @@ clean-help:
CLEANS += clean-run clean-help
-split-messages:
- $(call split_install_messages, ro, !NetSurf/Resources/)
-.PHONY: split-messages
-
# ----------------------------------------------------------------------------
# Template targets
# ----------------------------------------------------------------------------
@@ -127,6 +126,7 @@ split-messages:
TPL_RISCOS := de en fr nl # TODO: It'd be nice to auto-detect these
TPL_RISCOS := $(addprefix riscos/templates/,$(TPL_RISCOS))
+# Template target creation macro
define compile_template
!NetSurf/Resources/$(1)/Templates$$(TPLEXT): $(2)
$$(VQ)echo "TEMPLATE: $(2)"
--
NetSurf Browser
8 years, 1 month
netsurf: branch master updated. release/3.3-43-gd3c4eb7
by NetSurf Browser Project
Gitweb links:
...log http://git.netsurf-browser.org/netsurf.git/shortlog/d3c4eb73631b0f3fb5b08...
...commit http://git.netsurf-browser.org/netsurf.git/commit/d3c4eb73631b0f3fb5b0840...
...tree http://git.netsurf-browser.org/netsurf.git/tree/d3c4eb73631b0f3fb5b084005...
The branch, master has been updated
via d3c4eb73631b0f3fb5b08400592f438f0cf71f79 (commit)
via 2f2a73beea5e9e66505ba2adba98be83452fc93b (commit)
from ea9a2ff01d4ca599215a3bd943f7c5fd55d12f63 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=d3c4eb73631b0f3fb5b...
commit d3c4eb73631b0f3fb5b08400592f438f0cf71f79
Author: Vincent Sanders <vince(a)kyllikki.org>
Commit: Vincent Sanders <vince(a)kyllikki.org>
Move some beos specific make rules into its MAkefile.target
diff --git a/Makefile b/Makefile
index 3431ac9..3321086 100644
--- a/Makefile
+++ b/Makefile
@@ -623,15 +623,6 @@ ifeq ($(TARGET),beos)
$(Q)$(BEOS_MIMESET) $(EXETARGET)
endif
-ifeq ($(TARGET),beos)
-$(RDEF_IMP_BEOS): $(RDEP_BEOS)
- $(VQ)echo " GEN: $@"
- $(Q)n=5000; for f in $^; do echo "resource($$n,\"$${f#beos/res/}\") #'data' import \"$${f#beos/}\";"; n=$$(($$n+1)); done > $@
-
-$(RSRC_BEOS): $(RDEF_BEOS) $(RDEF_IMP_BEOS)
- $(VQ)echo " RC: $<"
- $(Q)$(BEOS_RC) -I beos -o $@ $^
-endif
clean-target:
$(VQ)echo " CLEAN: $(EXETARGET)"
diff --git a/beos/Makefile.target b/beos/Makefile.target
index 478593c..bab6429 100644
--- a/beos/Makefile.target
+++ b/beos/Makefile.target
@@ -27,8 +27,6 @@ BEOS_MIMESET := mimeset
VERSION_FULL := $(shell sed -n '/"/{s/.*"\(.*\)".*/\1/;p;}' desktop/version.c)
VERSION_MAJ := $(shell sed -n '/_major/{s/.* = \([0-9]*\).*/\1/;p;}' desktop/version.c)
VERSION_MIN := $(shell sed -n '/_minor/{s/.* = \([0-9]*\).*/\1/;p;}' desktop/version.c)
-RSRC_BEOS = $(addprefix $(OBJROOT)/,$(subst /,_,$(patsubst %.rdef,%.rsrc,$(RDEF_BEOS))))
-RESOURCES = $(RSRC_BEOS)
ifeq ($(HOST),beos)
CFLAGS += -I/boot/home/config/include \
@@ -124,6 +122,22 @@ SOURCES = $(S_COMMON) $(S_IMAGE) $(S_BROWSER) $(S_BEOS)
EXETARGET := NetSurf
# ----------------------------------------------------------------------------
+# Resources
+# ----------------------------------------------------------------------------
+
+RSRC_BEOS = $(addprefix $(OBJROOT)/,$(subst /,_,$(patsubst %.rdef,%.rsrc,$(RDEF_BEOS))))
+RESOURCES = $(RSRC_BEOS)
+
+$(RDEF_IMP_BEOS): $(RDEP_BEOS)
+ $(VQ)echo " GEN: $@"
+ $(Q)n=5000; for f in $^; do echo "resource($$n,\"$${f#beos/res/}\") #'data' import \"$${f#beos/}\";"; n=$$(($$n+1)); done > $@
+
+$(RSRC_BEOS): $(RDEF_BEOS) $(RDEF_IMP_BEOS)
+ $(VQ)echo " RC: $<"
+ $(Q)$(BEOS_RC) -I beos -o $@ $^
+
+
+# ----------------------------------------------------------------------------
# Install target
# ----------------------------------------------------------------------------
commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=2f2a73beea5e9e66505...
commit 2f2a73beea5e9e66505ba2adba98be83452fc93b
Author: Vincent Sanders <vince(a)kyllikki.org>
Commit: Vincent Sanders <vince(a)kyllikki.org>
Move some RISc OS specific Makefile rules into its Makefile.target
diff --git a/Makefile b/Makefile
index eef22af..3431ac9 100644
--- a/Makefile
+++ b/Makefile
@@ -633,39 +633,6 @@ $(RSRC_BEOS): $(RDEF_BEOS) $(RDEF_IMP_BEOS)
$(Q)$(BEOS_RC) -I beos -o $@ $^
endif
-ifeq ($(TARGET),riscos)
- # Native RO build is different as 1) it can't do piping and 2) ccres on
- # RO does not understand Unix filespec
- ifeq ($(HOST),riscos)
- define compile_template
-!NetSurf/Resources/$(1)/Templates$$(TPLEXT): $(2)
- $$(VQ)echo "TEMPLATE: $(2)"
- $$(Q)$$(CC) -x c -E -P $$(CFLAGS) -o processed_template $(2)
- $$(Q)$$(CCRES) processed_template $$(subst /,.,$$@)
- $$(Q)$(RM) processed_template
-CLEAN_TEMPLATES += !NetSurf/Resources/$(1)/Templates$$(TPLEXT)
-
- endef
- else
- define compile_template
-!NetSurf/Resources/$(1)/Templates$$(TPLEXT): $(2)
- $$(VQ)echo "TEMPLATE: $(2)"
- $$(Q)mkdir -p !NetSurf/Resources/$(1)
- $$(Q)$$(CC) -x c -E -P $$(CFLAGS) $(2) | $$(CCRES) - $$@
-CLEAN_TEMPLATES += !NetSurf/Resources/$(1)/Templates$$(TPLEXT)
-
- endef
- endif
-
-clean-templates:
- $(VQ)echo " CLEAN: $(CLEAN_TEMPLATES)"
- $(Q)$(RM) $(CLEAN_TEMPLATES)
-CLEANS += clean-templates
-
-$(eval $(foreach TPL,$(TPL_RISCOS), \
- $(call compile_template,$(notdir $(TPL)),$(TPL))))
-endif
-
clean-target:
$(VQ)echo " CLEAN: $(EXETARGET)"
$(Q)$(RM) $(EXETARGET)
diff --git a/riscos/Makefile.target b/riscos/Makefile.target
index dd1c34c..e40795c 100644
--- a/riscos/Makefile.target
+++ b/riscos/Makefile.target
@@ -20,22 +20,18 @@ $(eval $(call feature_enabled,DRAW,-DWITH_DRAW,,Drawfile rendering))
$(eval $(call feature_enabled,SPRITE,-DWITH_SPRITE,,Sprite rendering))
$(eval $(call feature_enabled,ARTWORKS,-DWITH_ARTWORKS,,ArtWorks rendering))
$(eval $(call feature_enabled,DRAW_EXPORT,-DWITH_DRAW_EXPORT,-lpencil,Drawfile export))
-ifeq ($(HOST),riscos)
- $(eval $(call feature_enabled,BMP,-DWITH_BMP,-lnsbmp,BMP (libnsbmp)))
- $(eval $(call feature_enabled,GIF,-DWITH_GIF,-lnsgif,GIF (libnsgif)))
- $(eval $(call feature_enabled,PNG,-DWITH_PNG,-lpng,PNG (libpng) ))
-else
- NETSURF_FEATURE_BMP_CFLAGS := -DWITH_BMP
- NETSURF_FEATURE_GIF_CFLAGS := -DWITH_GIF
- NETSURF_FEATURE_PNG_CFLAGS := -DWITH_PNG
- NETSURF_FEATURE_JS_CFLAGS := -DWITH_JS -DJS_HAS_FILE_OBJECT=0
- NETSURF_FEATURE_MOZJS_CFLAGS := -DWITH_MOZJS -DJS_HAS_FILE_OBJECT=0
- $(eval $(call pkg_config_find_and_add_enabled,BMP,libnsbmp,BMP))
- $(eval $(call pkg_config_find_and_add_enabled,GIF,libnsgif,GIF))
- $(eval $(call pkg_config_find_and_add_enabled,PNG,libpng,PNG ))
- $(eval $(call pkg_config_find_and_add_enabled,MOZJS,mozjs185,JavaScript))
- $(eval $(call pkg_config_find_and_add_enabled,JS,mozilla-js,JavaScript))
-endif
+
+NETSURF_FEATURE_BMP_CFLAGS := -DWITH_BMP
+NETSURF_FEATURE_GIF_CFLAGS := -DWITH_GIF
+NETSURF_FEATURE_PNG_CFLAGS := -DWITH_PNG
+NETSURF_FEATURE_JS_CFLAGS := -DWITH_JS -DJS_HAS_FILE_OBJECT=0
+NETSURF_FEATURE_MOZJS_CFLAGS := -DWITH_MOZJS -DJS_HAS_FILE_OBJECT=0
+$(eval $(call pkg_config_find_and_add_enabled,BMP,libnsbmp,BMP))
+$(eval $(call pkg_config_find_and_add_enabled,GIF,libnsgif,GIF))
+$(eval $(call pkg_config_find_and_add_enabled,PNG,libpng,PNG ))
+$(eval $(call pkg_config_find_and_add_enabled,MOZJS,mozjs185,JavaScript))
+$(eval $(call pkg_config_find_and_add_enabled,JS,mozilla-js,JavaScript))
+
TPD_RISCOS = $(foreach TPL,$(notdir $(TPL_RISCOS)), \
!NetSurf/Resources/$(TPL)/Templates$(TPLEXT))
@@ -85,14 +81,12 @@ S_RISCOS := 401login.c assert.c bitmap.c buffer.c cookies.c configure.c \
con_fonts.c con_home.c con_image.c con_inter.c con_language.c \
con_secure.c con_theme.c)
S_RISCOS := $(addprefix riscos/,$(S_RISCOS))
-TPL_RISCOS := de en fr nl # TODO: It'd be nice to auto-detect these
-TPL_RISCOS := $(addprefix riscos/templates/,$(TPL_RISCOS))
-
# This is the final source build list
# Note this is deliberately *not* expanded here as common and image
# are not yet available
SOURCES = $(S_COMMON) $(S_IMAGE) $(S_BROWSER) $(S_RISCOS)
+
EXETARGET := !NetSurf/!RunImage$(EXEEXT)
!NetSurf/!Run$(RUNEXT): riscos/scripts/Run $(EXETARGET)
@@ -126,6 +120,33 @@ split-messages:
.PHONY: split-messages
# ----------------------------------------------------------------------------
+# Template targets
+# ----------------------------------------------------------------------------
+
+# Template objects
+TPL_RISCOS := de en fr nl # TODO: It'd be nice to auto-detect these
+TPL_RISCOS := $(addprefix riscos/templates/,$(TPL_RISCOS))
+
+define compile_template
+!NetSurf/Resources/$(1)/Templates$$(TPLEXT): $(2)
+ $$(VQ)echo "TEMPLATE: $(2)"
+ $$(Q)mkdir -p !NetSurf/Resources/$(1)
+ $$(Q)$$(CC) -x c -E -P $$(CFLAGS) $(2) | $$(CCRES) - $$@
+
+CLEAN_TEMPLATES += !NetSurf/Resources/$(1)/Templates$$(TPLEXT)
+
+endef
+
+$(eval $(foreach TPL,$(TPL_RISCOS), \
+ $(call compile_template,$(notdir $(TPL)),$(TPL))))
+
+clean-templates:
+ $(VQ)echo " CLEAN: $(CLEAN_TEMPLATES)"
+ $(Q)$(RM) $(CLEAN_TEMPLATES)
+CLEANS += clean-templates
+
+
+# ----------------------------------------------------------------------------
# Install target
# ----------------------------------------------------------------------------
-----------------------------------------------------------------------
Summary of changes:
Makefile | 42 ----------------------------------
beos/Makefile.target | 18 +++++++++++++--
riscos/Makefile.target | 59 ++++++++++++++++++++++++++++++++----------------
3 files changed, 56 insertions(+), 63 deletions(-)
diff --git a/Makefile b/Makefile
index eef22af..3321086 100644
--- a/Makefile
+++ b/Makefile
@@ -623,48 +623,6 @@ ifeq ($(TARGET),beos)
$(Q)$(BEOS_MIMESET) $(EXETARGET)
endif
-ifeq ($(TARGET),beos)
-$(RDEF_IMP_BEOS): $(RDEP_BEOS)
- $(VQ)echo " GEN: $@"
- $(Q)n=5000; for f in $^; do echo "resource($$n,\"$${f#beos/res/}\") #'data' import \"$${f#beos/}\";"; n=$$(($$n+1)); done > $@
-
-$(RSRC_BEOS): $(RDEF_BEOS) $(RDEF_IMP_BEOS)
- $(VQ)echo " RC: $<"
- $(Q)$(BEOS_RC) -I beos -o $@ $^
-endif
-
-ifeq ($(TARGET),riscos)
- # Native RO build is different as 1) it can't do piping and 2) ccres on
- # RO does not understand Unix filespec
- ifeq ($(HOST),riscos)
- define compile_template
-!NetSurf/Resources/$(1)/Templates$$(TPLEXT): $(2)
- $$(VQ)echo "TEMPLATE: $(2)"
- $$(Q)$$(CC) -x c -E -P $$(CFLAGS) -o processed_template $(2)
- $$(Q)$$(CCRES) processed_template $$(subst /,.,$$@)
- $$(Q)$(RM) processed_template
-CLEAN_TEMPLATES += !NetSurf/Resources/$(1)/Templates$$(TPLEXT)
-
- endef
- else
- define compile_template
-!NetSurf/Resources/$(1)/Templates$$(TPLEXT): $(2)
- $$(VQ)echo "TEMPLATE: $(2)"
- $$(Q)mkdir -p !NetSurf/Resources/$(1)
- $$(Q)$$(CC) -x c -E -P $$(CFLAGS) $(2) | $$(CCRES) - $$@
-CLEAN_TEMPLATES += !NetSurf/Resources/$(1)/Templates$$(TPLEXT)
-
- endef
- endif
-
-clean-templates:
- $(VQ)echo " CLEAN: $(CLEAN_TEMPLATES)"
- $(Q)$(RM) $(CLEAN_TEMPLATES)
-CLEANS += clean-templates
-
-$(eval $(foreach TPL,$(TPL_RISCOS), \
- $(call compile_template,$(notdir $(TPL)),$(TPL))))
-endif
clean-target:
$(VQ)echo " CLEAN: $(EXETARGET)"
diff --git a/beos/Makefile.target b/beos/Makefile.target
index 478593c..bab6429 100644
--- a/beos/Makefile.target
+++ b/beos/Makefile.target
@@ -27,8 +27,6 @@ BEOS_MIMESET := mimeset
VERSION_FULL := $(shell sed -n '/"/{s/.*"\(.*\)".*/\1/;p;}' desktop/version.c)
VERSION_MAJ := $(shell sed -n '/_major/{s/.* = \([0-9]*\).*/\1/;p;}' desktop/version.c)
VERSION_MIN := $(shell sed -n '/_minor/{s/.* = \([0-9]*\).*/\1/;p;}' desktop/version.c)
-RSRC_BEOS = $(addprefix $(OBJROOT)/,$(subst /,_,$(patsubst %.rdef,%.rsrc,$(RDEF_BEOS))))
-RESOURCES = $(RSRC_BEOS)
ifeq ($(HOST),beos)
CFLAGS += -I/boot/home/config/include \
@@ -124,6 +122,22 @@ SOURCES = $(S_COMMON) $(S_IMAGE) $(S_BROWSER) $(S_BEOS)
EXETARGET := NetSurf
# ----------------------------------------------------------------------------
+# Resources
+# ----------------------------------------------------------------------------
+
+RSRC_BEOS = $(addprefix $(OBJROOT)/,$(subst /,_,$(patsubst %.rdef,%.rsrc,$(RDEF_BEOS))))
+RESOURCES = $(RSRC_BEOS)
+
+$(RDEF_IMP_BEOS): $(RDEP_BEOS)
+ $(VQ)echo " GEN: $@"
+ $(Q)n=5000; for f in $^; do echo "resource($$n,\"$${f#beos/res/}\") #'data' import \"$${f#beos/}\";"; n=$$(($$n+1)); done > $@
+
+$(RSRC_BEOS): $(RDEF_BEOS) $(RDEF_IMP_BEOS)
+ $(VQ)echo " RC: $<"
+ $(Q)$(BEOS_RC) -I beos -o $@ $^
+
+
+# ----------------------------------------------------------------------------
# Install target
# ----------------------------------------------------------------------------
diff --git a/riscos/Makefile.target b/riscos/Makefile.target
index dd1c34c..e40795c 100644
--- a/riscos/Makefile.target
+++ b/riscos/Makefile.target
@@ -20,22 +20,18 @@ $(eval $(call feature_enabled,DRAW,-DWITH_DRAW,,Drawfile rendering))
$(eval $(call feature_enabled,SPRITE,-DWITH_SPRITE,,Sprite rendering))
$(eval $(call feature_enabled,ARTWORKS,-DWITH_ARTWORKS,,ArtWorks rendering))
$(eval $(call feature_enabled,DRAW_EXPORT,-DWITH_DRAW_EXPORT,-lpencil,Drawfile export))
-ifeq ($(HOST),riscos)
- $(eval $(call feature_enabled,BMP,-DWITH_BMP,-lnsbmp,BMP (libnsbmp)))
- $(eval $(call feature_enabled,GIF,-DWITH_GIF,-lnsgif,GIF (libnsgif)))
- $(eval $(call feature_enabled,PNG,-DWITH_PNG,-lpng,PNG (libpng) ))
-else
- NETSURF_FEATURE_BMP_CFLAGS := -DWITH_BMP
- NETSURF_FEATURE_GIF_CFLAGS := -DWITH_GIF
- NETSURF_FEATURE_PNG_CFLAGS := -DWITH_PNG
- NETSURF_FEATURE_JS_CFLAGS := -DWITH_JS -DJS_HAS_FILE_OBJECT=0
- NETSURF_FEATURE_MOZJS_CFLAGS := -DWITH_MOZJS -DJS_HAS_FILE_OBJECT=0
- $(eval $(call pkg_config_find_and_add_enabled,BMP,libnsbmp,BMP))
- $(eval $(call pkg_config_find_and_add_enabled,GIF,libnsgif,GIF))
- $(eval $(call pkg_config_find_and_add_enabled,PNG,libpng,PNG ))
- $(eval $(call pkg_config_find_and_add_enabled,MOZJS,mozjs185,JavaScript))
- $(eval $(call pkg_config_find_and_add_enabled,JS,mozilla-js,JavaScript))
-endif
+
+NETSURF_FEATURE_BMP_CFLAGS := -DWITH_BMP
+NETSURF_FEATURE_GIF_CFLAGS := -DWITH_GIF
+NETSURF_FEATURE_PNG_CFLAGS := -DWITH_PNG
+NETSURF_FEATURE_JS_CFLAGS := -DWITH_JS -DJS_HAS_FILE_OBJECT=0
+NETSURF_FEATURE_MOZJS_CFLAGS := -DWITH_MOZJS -DJS_HAS_FILE_OBJECT=0
+$(eval $(call pkg_config_find_and_add_enabled,BMP,libnsbmp,BMP))
+$(eval $(call pkg_config_find_and_add_enabled,GIF,libnsgif,GIF))
+$(eval $(call pkg_config_find_and_add_enabled,PNG,libpng,PNG ))
+$(eval $(call pkg_config_find_and_add_enabled,MOZJS,mozjs185,JavaScript))
+$(eval $(call pkg_config_find_and_add_enabled,JS,mozilla-js,JavaScript))
+
TPD_RISCOS = $(foreach TPL,$(notdir $(TPL_RISCOS)), \
!NetSurf/Resources/$(TPL)/Templates$(TPLEXT))
@@ -85,14 +81,12 @@ S_RISCOS := 401login.c assert.c bitmap.c buffer.c cookies.c configure.c \
con_fonts.c con_home.c con_image.c con_inter.c con_language.c \
con_secure.c con_theme.c)
S_RISCOS := $(addprefix riscos/,$(S_RISCOS))
-TPL_RISCOS := de en fr nl # TODO: It'd be nice to auto-detect these
-TPL_RISCOS := $(addprefix riscos/templates/,$(TPL_RISCOS))
-
# This is the final source build list
# Note this is deliberately *not* expanded here as common and image
# are not yet available
SOURCES = $(S_COMMON) $(S_IMAGE) $(S_BROWSER) $(S_RISCOS)
+
EXETARGET := !NetSurf/!RunImage$(EXEEXT)
!NetSurf/!Run$(RUNEXT): riscos/scripts/Run $(EXETARGET)
@@ -126,6 +120,33 @@ split-messages:
.PHONY: split-messages
# ----------------------------------------------------------------------------
+# Template targets
+# ----------------------------------------------------------------------------
+
+# Template objects
+TPL_RISCOS := de en fr nl # TODO: It'd be nice to auto-detect these
+TPL_RISCOS := $(addprefix riscos/templates/,$(TPL_RISCOS))
+
+define compile_template
+!NetSurf/Resources/$(1)/Templates$$(TPLEXT): $(2)
+ $$(VQ)echo "TEMPLATE: $(2)"
+ $$(Q)mkdir -p !NetSurf/Resources/$(1)
+ $$(Q)$$(CC) -x c -E -P $$(CFLAGS) $(2) | $$(CCRES) - $$@
+
+CLEAN_TEMPLATES += !NetSurf/Resources/$(1)/Templates$$(TPLEXT)
+
+endef
+
+$(eval $(foreach TPL,$(TPL_RISCOS), \
+ $(call compile_template,$(notdir $(TPL)),$(TPL))))
+
+clean-templates:
+ $(VQ)echo " CLEAN: $(CLEAN_TEMPLATES)"
+ $(Q)$(RM) $(CLEAN_TEMPLATES)
+CLEANS += clean-templates
+
+
+# ----------------------------------------------------------------------------
# Install target
# ----------------------------------------------------------------------------
--
NetSurf Browser
8 years, 1 month
netsurf: branch master updated. release/3.3-41-gea9a2ff
by NetSurf Browser Project
Gitweb links:
...log http://git.netsurf-browser.org/netsurf.git/shortlog/ea9a2ff01d4ca599215a3...
...commit http://git.netsurf-browser.org/netsurf.git/commit/ea9a2ff01d4ca599215a3bd...
...tree http://git.netsurf-browser.org/netsurf.git/tree/ea9a2ff01d4ca599215a3bd94...
The branch, master has been updated
via ea9a2ff01d4ca599215a3bd943f7c5fd55d12f63 (commit)
from 77ffda1e46d602fa1efc6eac0e7c4f97f4dfbae1 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=ea9a2ff01d4ca599215...
commit ea9a2ff01d4ca599215a3bd943f7c5fd55d12f63
Author: Vincent Sanders <vince(a)kyllikki.org>
Commit: Vincent Sanders <vince(a)kyllikki.org>
Fix up some doxygen errors
diff --git a/beos/thumbnail.cpp b/beos/thumbnail.cpp
index dacefed..80944a5 100644
--- a/beos/thumbnail.cpp
+++ b/beos/thumbnail.cpp
@@ -54,7 +54,7 @@ extern status_t ScaleBitmap(const BBitmap& inBitmap, BBitmap& outBitmap);
*
* \param content content structure to thumbnail
* \param bitmap the bitmap to draw to
- * \param url the URL the thumnail belongs to, or NULL
+ * \return true on success and bitmap updated else false
*/
bool thumbnail_create(hlcache_handle *content, struct bitmap *bitmap)
{
diff --git a/content/fs_backing_store.c b/content/fs_backing_store.c
index 21b42f2..d23a9d1 100644
--- a/content/fs_backing_store.c
+++ b/content/fs_backing_store.c
@@ -1663,7 +1663,7 @@ static nserror store_write_file(struct store_state *state,
* takes ownership of the heap block passed in.
*
* @param url The url is used as the unique primary key for the data.
- * @param flags The flags to control how the object is stored.
+ * @param bsflags The flags to control how the object is stored.
* @param data The objects source data.
* @param datalen The length of the \a data.
* @return NSERROR_OK on success or error code on faliure.
diff --git a/gtk/thumbnail.c b/gtk/thumbnail.c
index 2edb579..ef95d0c 100644
--- a/gtk/thumbnail.c
+++ b/gtk/thumbnail.c
@@ -46,7 +46,7 @@
*
* \param content content structure to thumbnail
* \param bitmap the bitmap to draw to
- * \param url the URL the thumnail belongs to, or NULL
+ * \return true on success and bitmap updated else false
*/
bool thumbnail_create(hlcache_handle *content, struct bitmap *bitmap)
{
diff --git a/riscos/thumbnail.c b/riscos/thumbnail.c
index 9b8b52d..6613b0e 100644
--- a/riscos/thumbnail.c
+++ b/riscos/thumbnail.c
@@ -76,7 +76,7 @@ static void thumbnail_restore_output(struct thumbnail_save_area *save_area);
*
* \param content content structure to thumbnail
* \param bitmap the bitmap to draw to
- * \param url the URL the thumbnail belongs to, or NULL
+ * \return true on success and bitmap updated else false
*/
bool thumbnail_create(hlcache_handle *content, struct bitmap *bitmap)
{
diff --git a/windows/window.h b/windows/window.h
index 72c6ec5..ec54287 100644
--- a/windows/window.h
+++ b/windows/window.h
@@ -86,7 +86,7 @@ struct gui_window *nsws_get_gui_window(HWND hwnd);
* Cause a browser window to navigate to a url
*
* \param hwnd The win32 handle to the browser window or one of its decendants.
- * \param url The URL to navigate to.
+ * \param urltxt The URL to navigate to.
*/
bool nsws_window_go(HWND hwnd, const char *urltxt);
-----------------------------------------------------------------------
Summary of changes:
beos/thumbnail.cpp | 2 +-
content/fs_backing_store.c | 2 +-
gtk/thumbnail.c | 2 +-
riscos/thumbnail.c | 2 +-
windows/window.h | 2 +-
5 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/beos/thumbnail.cpp b/beos/thumbnail.cpp
index dacefed..80944a5 100644
--- a/beos/thumbnail.cpp
+++ b/beos/thumbnail.cpp
@@ -54,7 +54,7 @@ extern status_t ScaleBitmap(const BBitmap& inBitmap, BBitmap& outBitmap);
*
* \param content content structure to thumbnail
* \param bitmap the bitmap to draw to
- * \param url the URL the thumnail belongs to, or NULL
+ * \return true on success and bitmap updated else false
*/
bool thumbnail_create(hlcache_handle *content, struct bitmap *bitmap)
{
diff --git a/content/fs_backing_store.c b/content/fs_backing_store.c
index 21b42f2..d23a9d1 100644
--- a/content/fs_backing_store.c
+++ b/content/fs_backing_store.c
@@ -1663,7 +1663,7 @@ static nserror store_write_file(struct store_state *state,
* takes ownership of the heap block passed in.
*
* @param url The url is used as the unique primary key for the data.
- * @param flags The flags to control how the object is stored.
+ * @param bsflags The flags to control how the object is stored.
* @param data The objects source data.
* @param datalen The length of the \a data.
* @return NSERROR_OK on success or error code on faliure.
diff --git a/gtk/thumbnail.c b/gtk/thumbnail.c
index 2edb579..ef95d0c 100644
--- a/gtk/thumbnail.c
+++ b/gtk/thumbnail.c
@@ -46,7 +46,7 @@
*
* \param content content structure to thumbnail
* \param bitmap the bitmap to draw to
- * \param url the URL the thumnail belongs to, or NULL
+ * \return true on success and bitmap updated else false
*/
bool thumbnail_create(hlcache_handle *content, struct bitmap *bitmap)
{
diff --git a/riscos/thumbnail.c b/riscos/thumbnail.c
index 9b8b52d..6613b0e 100644
--- a/riscos/thumbnail.c
+++ b/riscos/thumbnail.c
@@ -76,7 +76,7 @@ static void thumbnail_restore_output(struct thumbnail_save_area *save_area);
*
* \param content content structure to thumbnail
* \param bitmap the bitmap to draw to
- * \param url the URL the thumbnail belongs to, or NULL
+ * \return true on success and bitmap updated else false
*/
bool thumbnail_create(hlcache_handle *content, struct bitmap *bitmap)
{
diff --git a/windows/window.h b/windows/window.h
index 72c6ec5..ec54287 100644
--- a/windows/window.h
+++ b/windows/window.h
@@ -86,7 +86,7 @@ struct gui_window *nsws_get_gui_window(HWND hwnd);
* Cause a browser window to navigate to a url
*
* \param hwnd The win32 handle to the browser window or one of its decendants.
- * \param url The URL to navigate to.
+ * \param urltxt The URL to navigate to.
*/
bool nsws_window_go(HWND hwnd, const char *urltxt);
--
NetSurf Browser
8 years, 2 months
netsurf: branch master updated. release/3.3-40-g77ffda1
by NetSurf Browser Project
Gitweb links:
...log http://git.netsurf-browser.org/netsurf.git/shortlog/77ffda1e46d602fa1efc6...
...commit http://git.netsurf-browser.org/netsurf.git/commit/77ffda1e46d602fa1efc6ea...
...tree http://git.netsurf-browser.org/netsurf.git/tree/77ffda1e46d602fa1efc6eac0...
The branch, master has been updated
via 77ffda1e46d602fa1efc6eac0e7c4f97f4dfbae1 (commit)
via 47d08b6506a16b1d8a806d9dfa971398553a250e (commit)
from 576b1c55bf5a8b37983e1581a6c0cc1a9d7158f5 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=77ffda1e46d602fa1ef...
commit 77ffda1e46d602fa1efc6eac0e7c4f97f4dfbae1
Author: Vincent Sanders <vince(a)kyllikki.org>
Commit: Vincent Sanders <vince(a)kyllikki.org>
Use nsutils unistd operations for pread and pwrite to get consistant interface
diff --git a/content/fs_backing_store.c b/content/fs_backing_store.c
index f884a74..21b42f2 100644
--- a/content/fs_backing_store.c
+++ b/content/fs_backing_store.c
@@ -43,6 +43,7 @@
#include <errno.h>
#include <time.h>
#include <stdlib.h>
+#include <nsutils/unistd.h>
#include "utils/filepath.h"
#include "utils/file.h"
@@ -1597,7 +1598,7 @@ static nserror store_write_block(struct store_state *state,
offst = bi << log2_block_size[elem_idx];
- wr = pwrite(state->blocks[elem_idx][bf].fd,
+ wr = nsu_pwrite(state->blocks[elem_idx][bf].fd,
bse->elem[elem_idx].data,
bse->elem[elem_idx].size,
offst);
@@ -1753,7 +1754,7 @@ static nserror store_read_block(struct store_state *state,
offst = bi << log2_block_size[elem_idx];
- rd = pread(state->blocks[elem_idx][bf].fd,
+ rd = nsu_pread(state->blocks[elem_idx][bf].fd,
bse->elem[elem_idx].data,
bse->elem[elem_idx].size,
offst);
commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=47d08b6506a16b1d8a8...
commit 47d08b6506a16b1d8a806d9dfa971398553a250e
Author: Vincent Sanders <vince(a)kyllikki.org>
Commit: Vincent Sanders <vince(a)kyllikki.org>
Revert "Fix RISC OS not having a pread/pwrite implementation."
This reverts commit 82c7a7a4baf4a7a15381ee720799dc41c3d54909.
Conflicts:
content/fs_backing_store.c
diff --git a/content/fs_backing_store.c b/content/fs_backing_store.c
index 638a109..f884a74 100644
--- a/content/fs_backing_store.c
+++ b/content/fs_backing_store.c
@@ -35,8 +35,6 @@
*
*/
-#include "utils/config.h"
-
#include <unistd.h>
#include <string.h>
#include <sys/stat.h>
diff --git a/utils/config.h b/utils/config.h
index cfb9d83..2af38c0 100644
--- a/utils/config.h
+++ b/utils/config.h
@@ -59,19 +59,6 @@ char *strcasestr(const char *haystack, const char *needle);
char *strchrnul(const char *s, int c);
#endif
-/* Although these are in POSIX and implemented most places, RISC OS is
- * missing them.
- */
-#if (defined(riscos))
-#undef HAVE_PREAD
-#undef HAVE_PWRITE
-ssize_t pread(int fd, void *buf, size_t count, off_t offset);
-ssize_t pwrite(int fd, const void *buf, size_t count, off_t offset);
-#else
-#define HAVE_PREAD
-#define HAVE_PWRITE
-#endif
-
#define HAVE_SYS_SELECT
#define HAVE_INETATON
#if (defined(_WIN32))
diff --git a/utils/utils.c b/utils/utils.c
index 722e323..5c8acd6 100644
--- a/utils/utils.c
+++ b/utils/utils.c
@@ -32,7 +32,6 @@
#include <regex.h>
#include <time.h>
#include <errno.h>
-#include <unistd.h>
#include "utils/config.h"
#include "utils/log.h"
@@ -629,34 +628,3 @@ nserror nsc_snptimet(char *str, size_t size, time_t *timep)
return NSERROR_OK;
}
-
-#ifndef HAVE_PREAD
-
-ssize_t pread(int fd, void *buf, size_t count, off_t offset)
-{
- off_t sk;
-
- sk = lseek(fd, offset, SEEK_SET);
- if (sk == -1) {
- return (off_t)-1;
- }
- return read(fd, buf, count);
-}
-
-#endif
-
-
-#ifndef HAVE_PWRITE
-
-ssize_t pwrite(int fd, const void *buf, size_t count, off_t offset)
-{
- off_t sk;
-
- sk = lseek(fd, offset, SEEK_SET);
- if (sk == (off_t)-1) {
- return -1;
- }
- return write(fd, buf, count);
-}
-
-#endif
-----------------------------------------------------------------------
Summary of changes:
content/fs_backing_store.c | 7 +++----
utils/config.h | 13 -------------
utils/utils.c | 32 --------------------------------
3 files changed, 3 insertions(+), 49 deletions(-)
diff --git a/content/fs_backing_store.c b/content/fs_backing_store.c
index 638a109..21b42f2 100644
--- a/content/fs_backing_store.c
+++ b/content/fs_backing_store.c
@@ -35,8 +35,6 @@
*
*/
-#include "utils/config.h"
-
#include <unistd.h>
#include <string.h>
#include <sys/stat.h>
@@ -45,6 +43,7 @@
#include <errno.h>
#include <time.h>
#include <stdlib.h>
+#include <nsutils/unistd.h>
#include "utils/filepath.h"
#include "utils/file.h"
@@ -1599,7 +1598,7 @@ static nserror store_write_block(struct store_state *state,
offst = bi << log2_block_size[elem_idx];
- wr = pwrite(state->blocks[elem_idx][bf].fd,
+ wr = nsu_pwrite(state->blocks[elem_idx][bf].fd,
bse->elem[elem_idx].data,
bse->elem[elem_idx].size,
offst);
@@ -1755,7 +1754,7 @@ static nserror store_read_block(struct store_state *state,
offst = bi << log2_block_size[elem_idx];
- rd = pread(state->blocks[elem_idx][bf].fd,
+ rd = nsu_pread(state->blocks[elem_idx][bf].fd,
bse->elem[elem_idx].data,
bse->elem[elem_idx].size,
offst);
diff --git a/utils/config.h b/utils/config.h
index cfb9d83..2af38c0 100644
--- a/utils/config.h
+++ b/utils/config.h
@@ -59,19 +59,6 @@ char *strcasestr(const char *haystack, const char *needle);
char *strchrnul(const char *s, int c);
#endif
-/* Although these are in POSIX and implemented most places, RISC OS is
- * missing them.
- */
-#if (defined(riscos))
-#undef HAVE_PREAD
-#undef HAVE_PWRITE
-ssize_t pread(int fd, void *buf, size_t count, off_t offset);
-ssize_t pwrite(int fd, const void *buf, size_t count, off_t offset);
-#else
-#define HAVE_PREAD
-#define HAVE_PWRITE
-#endif
-
#define HAVE_SYS_SELECT
#define HAVE_INETATON
#if (defined(_WIN32))
diff --git a/utils/utils.c b/utils/utils.c
index 722e323..5c8acd6 100644
--- a/utils/utils.c
+++ b/utils/utils.c
@@ -32,7 +32,6 @@
#include <regex.h>
#include <time.h>
#include <errno.h>
-#include <unistd.h>
#include "utils/config.h"
#include "utils/log.h"
@@ -629,34 +628,3 @@ nserror nsc_snptimet(char *str, size_t size, time_t *timep)
return NSERROR_OK;
}
-
-#ifndef HAVE_PREAD
-
-ssize_t pread(int fd, void *buf, size_t count, off_t offset)
-{
- off_t sk;
-
- sk = lseek(fd, offset, SEEK_SET);
- if (sk == -1) {
- return (off_t)-1;
- }
- return read(fd, buf, count);
-}
-
-#endif
-
-
-#ifndef HAVE_PWRITE
-
-ssize_t pwrite(int fd, const void *buf, size_t count, off_t offset)
-{
- off_t sk;
-
- sk = lseek(fd, offset, SEEK_SET);
- if (sk == (off_t)-1) {
- return -1;
- }
- return write(fd, buf, count);
-}
-
-#endif
--
NetSurf Browser
8 years, 2 months
libnsutils: branch master updated. release/0.0.1-6-g22cadbb
by NetSurf Browser Project
Gitweb links:
...log http://git.netsurf-browser.org/libnsutils.git/shortlog/22cadbba395422e329...
...commit http://git.netsurf-browser.org/libnsutils.git/commit/22cadbba395422e32988...
...tree http://git.netsurf-browser.org/libnsutils.git/tree/22cadbba395422e32988e3...
The branch, master has been updated
via 22cadbba395422e32988e3d16e1a12ab9a85648d (commit)
from 8aa0a0c18f3c9b27b740aefd0ec4c3e2f34f7fd2 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commitdiff http://git.netsurf-browser.org/libnsutils.git/commit/?id=22cadbba395422e3...
commit 22cadbba395422e32988e3d16e1a12ab9a85648d
Author: Vincent Sanders <vince(a)kyllikki.org>
Commit: Vincent Sanders <vince(a)kyllikki.org>
fix up unistd operations for amigaos 3 and win32 targets
diff --git a/Makefile b/Makefile
index 833cc1d..73dba09 100644
--- a/Makefile
+++ b/Makefile
@@ -52,5 +52,6 @@ I := /$(INCLUDEDIR)/nsutils
INSTALL_ITEMS := $(INSTALL_ITEMS) $(I):include/nsutils/errors.h
INSTALL_ITEMS := $(INSTALL_ITEMS) $(I):include/nsutils/base64.h
INSTALL_ITEMS := $(INSTALL_ITEMS) $(I):include/nsutils/time.h
+INSTALL_ITEMS := $(INSTALL_ITEMS) $(I):include/nsutils/unistd.h
INSTALL_ITEMS := $(INSTALL_ITEMS) /$(LIBDIR)/pkgconfig:lib$(COMPONENT).pc.in
INSTALL_ITEMS := $(INSTALL_ITEMS) /$(LIBDIR):$(OUTPUT)
diff --git a/src/unistd.c b/src/unistd.c
index e8c5a0a..8791a44 100644
--- a/src/unistd.c
+++ b/src/unistd.c
@@ -21,7 +21,7 @@
/* exported interface documented in nsutils/unistd.h */
ssize_t nsu_pwrite(int fd, const void *buf, size_t count, off_t offset)
{
-#if defined(__riscos) || defined(__amiga)
+#if (defined(__riscos) || defined(__amiga) || defined(_WIN32))
off_t sk;
sk = lseek(fd, offset, SEEK_SET);
@@ -53,7 +53,7 @@ ssize_t nsu_pwrite(int fd, const void *buf, size_t count, off_t offset)
/* exported interface documented in nsutils/unistd.h */
ssize_t nsu_pread(int fd, void *buf, size_t count, off_t offset)
{
-#if defined(__riscos)
+#if (defined(__riscos) || defined(_WIN32) || (defined(__amiga) && !defined(__amigaos4__)))
off_t sk;
sk = lseek(fd, offset, SEEK_SET);
-----------------------------------------------------------------------
Summary of changes:
Makefile | 1 +
src/unistd.c | 4 ++--
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/Makefile b/Makefile
index 833cc1d..73dba09 100644
--- a/Makefile
+++ b/Makefile
@@ -52,5 +52,6 @@ I := /$(INCLUDEDIR)/nsutils
INSTALL_ITEMS := $(INSTALL_ITEMS) $(I):include/nsutils/errors.h
INSTALL_ITEMS := $(INSTALL_ITEMS) $(I):include/nsutils/base64.h
INSTALL_ITEMS := $(INSTALL_ITEMS) $(I):include/nsutils/time.h
+INSTALL_ITEMS := $(INSTALL_ITEMS) $(I):include/nsutils/unistd.h
INSTALL_ITEMS := $(INSTALL_ITEMS) /$(LIBDIR)/pkgconfig:lib$(COMPONENT).pc.in
INSTALL_ITEMS := $(INSTALL_ITEMS) /$(LIBDIR):$(OUTPUT)
diff --git a/src/unistd.c b/src/unistd.c
index e8c5a0a..8791a44 100644
--- a/src/unistd.c
+++ b/src/unistd.c
@@ -21,7 +21,7 @@
/* exported interface documented in nsutils/unistd.h */
ssize_t nsu_pwrite(int fd, const void *buf, size_t count, off_t offset)
{
-#if defined(__riscos) || defined(__amiga)
+#if (defined(__riscos) || defined(__amiga) || defined(_WIN32))
off_t sk;
sk = lseek(fd, offset, SEEK_SET);
@@ -53,7 +53,7 @@ ssize_t nsu_pwrite(int fd, const void *buf, size_t count, off_t offset)
/* exported interface documented in nsutils/unistd.h */
ssize_t nsu_pread(int fd, void *buf, size_t count, off_t offset)
{
-#if defined(__riscos)
+#if (defined(__riscos) || defined(_WIN32) || (defined(__amiga) && !defined(__amigaos4__)))
off_t sk;
sk = lseek(fd, offset, SEEK_SET);
--
NetSurf generalised utility library
8 years, 2 months
libnsutils: branch master updated. release/0.0.1-5-g8aa0a0c
by NetSurf Browser Project
Gitweb links:
...log http://git.netsurf-browser.org/libnsutils.git/shortlog/8aa0a0c18f3c9b27b7...
...commit http://git.netsurf-browser.org/libnsutils.git/commit/8aa0a0c18f3c9b27b740...
...tree http://git.netsurf-browser.org/libnsutils.git/tree/8aa0a0c18f3c9b27b740ae...
The branch, master has been updated
via 8aa0a0c18f3c9b27b740aefd0ec4c3e2f34f7fd2 (commit)
from e9e4ee6ffa7fa316ba8d479e19639391a3d58e57 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commitdiff http://git.netsurf-browser.org/libnsutils.git/commit/?id=8aa0a0c18f3c9b27...
commit 8aa0a0c18f3c9b27b740aefd0ec4c3e2f34f7fd2
Author: Vincent Sanders <vince(a)kyllikki.org>
Commit: Vincent Sanders <vince(a)kyllikki.org>
need _GNU_SOURCE to be defined to get useful unistd on some platforms
diff --git a/Makefile b/Makefile
index e84dc12..833cc1d 100644
--- a/Makefile
+++ b/Makefile
@@ -23,7 +23,7 @@ WARNFLAGS := -Wall -W -Wundef -Wpointer-arith -Wcast-align \
-Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes \
-Wmissing-declarations -Wnested-externs
-CFLAGS := -D_BSD_SOURCE -D_DEFAULT_SOURCE \
+CFLAGS := -D_GNU_SOURCE -D_DEFAULT_SOURCE \
-I$(CURDIR)/include/ -I$(CURDIR)/src $(WARNFLAGS) $(CFLAGS)
ifneq ($(GCCVER),2)
CFLAGS := $(CFLAGS) -std=c99
-----------------------------------------------------------------------
Summary of changes:
Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Makefile b/Makefile
index e84dc12..833cc1d 100644
--- a/Makefile
+++ b/Makefile
@@ -23,7 +23,7 @@ WARNFLAGS := -Wall -W -Wundef -Wpointer-arith -Wcast-align \
-Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes \
-Wmissing-declarations -Wnested-externs
-CFLAGS := -D_BSD_SOURCE -D_DEFAULT_SOURCE \
+CFLAGS := -D_GNU_SOURCE -D_DEFAULT_SOURCE \
-I$(CURDIR)/include/ -I$(CURDIR)/src $(WARNFLAGS) $(CFLAGS)
ifneq ($(GCCVER),2)
CFLAGS := $(CFLAGS) -std=c99
--
NetSurf generalised utility library
8 years, 2 months
libnsutils: branch master updated. release/0.0.1-4-ge9e4ee6
by NetSurf Browser Project
Gitweb links:
...log http://git.netsurf-browser.org/libnsutils.git/shortlog/e9e4ee6ffa7fa316ba...
...commit http://git.netsurf-browser.org/libnsutils.git/commit/e9e4ee6ffa7fa316ba8d...
...tree http://git.netsurf-browser.org/libnsutils.git/tree/e9e4ee6ffa7fa316ba8d47...
The branch, master has been updated
via e9e4ee6ffa7fa316ba8d479e19639391a3d58e57 (commit)
from 7edbb1ad09a34424f295b123505f0aa69c696a72 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commitdiff http://git.netsurf-browser.org/libnsutils.git/commit/?id=e9e4ee6ffa7fa316...
commit e9e4ee6ffa7fa316ba8d479e19639391a3d58e57
Author: Vincent Sanders <vince(a)kyllikki.org>
Commit: Vincent Sanders <vince(a)kyllikki.org>
need _BSD_SOURCE to be defined to get useful unistd on some platforms
diff --git a/Makefile b/Makefile
index 10b2120..e84dc12 100644
--- a/Makefile
+++ b/Makefile
@@ -23,7 +23,8 @@ WARNFLAGS := -Wall -W -Wundef -Wpointer-arith -Wcast-align \
-Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes \
-Wmissing-declarations -Wnested-externs
-CFLAGS := -I$(CURDIR)/include/ -I$(CURDIR)/src $(WARNFLAGS) $(CFLAGS)
+CFLAGS := -D_BSD_SOURCE -D_DEFAULT_SOURCE \
+ -I$(CURDIR)/include/ -I$(CURDIR)/src $(WARNFLAGS) $(CFLAGS)
ifneq ($(GCCVER),2)
CFLAGS := $(CFLAGS) -std=c99
else
-----------------------------------------------------------------------
Summary of changes:
Makefile | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/Makefile b/Makefile
index 10b2120..e84dc12 100644
--- a/Makefile
+++ b/Makefile
@@ -23,7 +23,8 @@ WARNFLAGS := -Wall -W -Wundef -Wpointer-arith -Wcast-align \
-Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes \
-Wmissing-declarations -Wnested-externs
-CFLAGS := -I$(CURDIR)/include/ -I$(CURDIR)/src $(WARNFLAGS) $(CFLAGS)
+CFLAGS := -D_BSD_SOURCE -D_DEFAULT_SOURCE \
+ -I$(CURDIR)/include/ -I$(CURDIR)/src $(WARNFLAGS) $(CFLAGS)
ifneq ($(GCCVER),2)
CFLAGS := $(CFLAGS) -std=c99
else
--
NetSurf generalised utility library
8 years, 2 months
libnsutils: branch master updated. release/0.0.1-2-g2d6282f
by NetSurf Browser Project
Gitweb links:
...log http://git.netsurf-browser.org/libnsutils.git/shortlog/2d6282f46bf44ea82e...
...commit http://git.netsurf-browser.org/libnsutils.git/commit/2d6282f46bf44ea82ea9...
...tree http://git.netsurf-browser.org/libnsutils.git/tree/2d6282f46bf44ea82ea9cc...
The branch, master has been updated
via 2d6282f46bf44ea82ea9cc562f62af4456714052 (commit)
from ee700511bdd5af06304382abf0d6ff4cc9bd43f0 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commitdiff http://git.netsurf-browser.org/libnsutils.git/commit/?id=2d6282f46bf44ea8...
commit 2d6282f46bf44ea82ea9cc562f62af4456714052
Author: Vincent Sanders <vince(a)kyllikki.org>
Commit: Vincent Sanders <vince(a)kyllikki.org>
Added pread and pwrite wrappers.
This adds wrappers for the pread and pwrite standard calls with fixed
semantics across all supported platforms.
The main variation (so far) is some platforms not having the calls at
all and AmigaOS not allowing seeks beyond existing extents.
diff --git a/Makefile b/Makefile
index fa44370..10b2120 100644
--- a/Makefile
+++ b/Makefile
@@ -1,6 +1,12 @@
+#!/bin/make
+#
+# Makefile for libnsutils
+#
+# Copyright 2014-1015 Vincent Sanders <vince(a)netsurf-browser.org>
+
# Component settings
COMPONENT := nsutils
-COMPONENT_VERSION := 0.0.1
+COMPONENT_VERSION := 0.0.2
# Default to a static library
COMPONENT_TYPE ?= lib-static
@@ -16,6 +22,7 @@ TESTRUNNER = test/runtest.sh $(BUILDDIR) $(EXEEXT)
WARNFLAGS := -Wall -W -Wundef -Wpointer-arith -Wcast-align \
-Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes \
-Wmissing-declarations -Wnested-externs
+
CFLAGS := -I$(CURDIR)/include/ -I$(CURDIR)/src $(WARNFLAGS) $(CFLAGS)
ifneq ($(GCCVER),2)
CFLAGS := $(CFLAGS) -std=c99
diff --git a/include/nsutils/time.h b/include/nsutils/time.h
index 715d3e4..db60914 100644
--- a/include/nsutils/time.h
+++ b/include/nsutils/time.h
@@ -9,7 +9,7 @@
/**
* \file
- * Base64 encoding and decoding interface.
+ * Time related operations.
*/
#ifndef NSUTILS_TIME_H_
diff --git a/include/nsutils/unistd.h b/include/nsutils/unistd.h
new file mode 100644
index 0000000..be11382
--- /dev/null
+++ b/include/nsutils/unistd.h
@@ -0,0 +1,55 @@
+/*
+ * Copyright 2015 Vincent Sanders <vince(a)netsurf-browser.org>
+ *
+ * This file is part of libnsutils.
+ *
+ * Licensed under the MIT License,
+ * http://www.opensource.org/licenses/mit-license.php
+ */
+
+/**
+ * \file
+ * Time related operations.
+ */
+
+#ifndef NSUTILS_UNISTD_H_
+#define NSUTILS_UNISTD_H_
+
+/**
+ * Perform a write operation at a specific offset
+ *
+ * This writes the data into the file specifid by teh file handle at teh given
+ * offset. The offset may be beyond the existing file extent.
+ *
+ * This provides a uniform interface to the pwrite operation without system
+ * specific implementation details.
+ *
+ * \note The write pointer on the fd may be moved by this operation which
+ * differs from the posix version.
+ *
+ * \param fd The file descriptor.
+ * \param buf The data to write.
+ * \param count The length of data in \a buf to write.
+ * \param offset The offset into the file to write the data.
+ * \return the number of bytes written or -1 on error and errno set.
+ */
+ssize_t nsu_pwrite(int fd, const void *buf, size_t count, off_t offset);
+
+/**
+ * Perform a read from a specific offset.
+ *
+ * This provides a uniform interface to the POSIX pread operation without
+ * system specific implementation details.
+ *
+ * \note The read pointer on the fd may be moved by this operation which
+ * differs from the POSIX version.
+ *
+ * \param fd The file descriptor.
+ * \param buf The buffer to place the data into.
+ * \param count The length of data to read.
+ * \param offset The offset into the file to read the data from.
+ * \return the number of bytes read or -1 on error and errno set.
+ */
+ssize_t nsu_pread(int fd, void *buf, size_t count, off_t offset);
+
+#endif
diff --git a/src/Makefile b/src/Makefile
index 28bfc5f..b4fd96a 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -1,3 +1,3 @@
-DIR_SOURCES := base64.c time.c
+DIR_SOURCES := base64.c time.c unistd.c
include $(NSBUILD)/Makefile.subdir
diff --git a/src/unistd.c b/src/unistd.c
new file mode 100644
index 0000000..219e9ec
--- /dev/null
+++ b/src/unistd.c
@@ -0,0 +1,67 @@
+/*
+ * Copyright 2015 Vincent Sanders <vince(a)netsurf-browser.org>
+ *
+ * This file is part of libnsutils.
+ *
+ * Licensed under the MIT License,
+ * http://www.opensource.org/licenses/mit-license.php
+ */
+
+/**
+ * \file
+ * unistd style operations.
+ */
+
+#include <unistd.h>
+#include <errno.h>
+
+#include "nsutils/unistd.h"
+
+/* exported interface documented in nsutils/unistd.h */
+ssize_t nsu_pwrite(int fd, const void *buf, size_t count, off_t offset)
+{
+#if defined(__riscos) || defined(__amiga)
+ off_t sk;
+
+ sk = lseek(fd, offset, SEEK_SET);
+ if (sk == (off_t)-1) {
+#if defined(__amiga)
+ /* amigaos cannot seek past the end of the existing file so use
+ * ftruncate to make the file long enough and retry the seek.
+ */
+ int ret;
+ if (errno == ESPIPE) {
+ ret = ftruncate(fd, offset);
+ if (ret == -1) {
+ return -1;
+ }
+ sk = lseek(fd, offset, SEEK_SET);
+ if (sk == (off_t)-1) {
+ return -1;
+ }
+ } else
+#endif
+ return -1;
+ }
+ return write(fd, buf, count);
+#else
+ return pwrite(fd, buf, count, offset);
+#endif
+}
+
+/* exported interface documented in nsutils/unistd.h */
+ssize_t nsu_pread(int fd, void *buf, size_t count, off_t offset)
+{
+#if defined(__riscos)
+ off_t sk;
+
+ sk = lseek(fd, offset, SEEK_SET);
+ if (sk == -1) {
+ return (off_t)-1;
+ }
+ return read(fd, buf, count);
+#else
+ return pread(fd, buf, count, offset);
+#endif
+
+}
-----------------------------------------------------------------------
Summary of changes:
Makefile | 9 ++++++-
include/nsutils/time.h | 2 +-
include/nsutils/unistd.h | 55 +++++++++++++++++++++++++++++++++++++
src/Makefile | 2 +-
src/unistd.c | 67 ++++++++++++++++++++++++++++++++++++++++++++++
5 files changed, 132 insertions(+), 3 deletions(-)
create mode 100644 include/nsutils/unistd.h
create mode 100644 src/unistd.c
diff --git a/Makefile b/Makefile
index fa44370..10b2120 100644
--- a/Makefile
+++ b/Makefile
@@ -1,6 +1,12 @@
+#!/bin/make
+#
+# Makefile for libnsutils
+#
+# Copyright 2014-1015 Vincent Sanders <vince(a)netsurf-browser.org>
+
# Component settings
COMPONENT := nsutils
-COMPONENT_VERSION := 0.0.1
+COMPONENT_VERSION := 0.0.2
# Default to a static library
COMPONENT_TYPE ?= lib-static
@@ -16,6 +22,7 @@ TESTRUNNER = test/runtest.sh $(BUILDDIR) $(EXEEXT)
WARNFLAGS := -Wall -W -Wundef -Wpointer-arith -Wcast-align \
-Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes \
-Wmissing-declarations -Wnested-externs
+
CFLAGS := -I$(CURDIR)/include/ -I$(CURDIR)/src $(WARNFLAGS) $(CFLAGS)
ifneq ($(GCCVER),2)
CFLAGS := $(CFLAGS) -std=c99
diff --git a/include/nsutils/time.h b/include/nsutils/time.h
index 715d3e4..db60914 100644
--- a/include/nsutils/time.h
+++ b/include/nsutils/time.h
@@ -9,7 +9,7 @@
/**
* \file
- * Base64 encoding and decoding interface.
+ * Time related operations.
*/
#ifndef NSUTILS_TIME_H_
diff --git a/include/nsutils/unistd.h b/include/nsutils/unistd.h
new file mode 100644
index 0000000..be11382
--- /dev/null
+++ b/include/nsutils/unistd.h
@@ -0,0 +1,55 @@
+/*
+ * Copyright 2015 Vincent Sanders <vince(a)netsurf-browser.org>
+ *
+ * This file is part of libnsutils.
+ *
+ * Licensed under the MIT License,
+ * http://www.opensource.org/licenses/mit-license.php
+ */
+
+/**
+ * \file
+ * Time related operations.
+ */
+
+#ifndef NSUTILS_UNISTD_H_
+#define NSUTILS_UNISTD_H_
+
+/**
+ * Perform a write operation at a specific offset
+ *
+ * This writes the data into the file specifid by teh file handle at teh given
+ * offset. The offset may be beyond the existing file extent.
+ *
+ * This provides a uniform interface to the pwrite operation without system
+ * specific implementation details.
+ *
+ * \note The write pointer on the fd may be moved by this operation which
+ * differs from the posix version.
+ *
+ * \param fd The file descriptor.
+ * \param buf The data to write.
+ * \param count The length of data in \a buf to write.
+ * \param offset The offset into the file to write the data.
+ * \return the number of bytes written or -1 on error and errno set.
+ */
+ssize_t nsu_pwrite(int fd, const void *buf, size_t count, off_t offset);
+
+/**
+ * Perform a read from a specific offset.
+ *
+ * This provides a uniform interface to the POSIX pread operation without
+ * system specific implementation details.
+ *
+ * \note The read pointer on the fd may be moved by this operation which
+ * differs from the POSIX version.
+ *
+ * \param fd The file descriptor.
+ * \param buf The buffer to place the data into.
+ * \param count The length of data to read.
+ * \param offset The offset into the file to read the data from.
+ * \return the number of bytes read or -1 on error and errno set.
+ */
+ssize_t nsu_pread(int fd, void *buf, size_t count, off_t offset);
+
+#endif
diff --git a/src/Makefile b/src/Makefile
index 28bfc5f..b4fd96a 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -1,3 +1,3 @@
-DIR_SOURCES := base64.c time.c
+DIR_SOURCES := base64.c time.c unistd.c
include $(NSBUILD)/Makefile.subdir
diff --git a/src/unistd.c b/src/unistd.c
new file mode 100644
index 0000000..219e9ec
--- /dev/null
+++ b/src/unistd.c
@@ -0,0 +1,67 @@
+/*
+ * Copyright 2015 Vincent Sanders <vince(a)netsurf-browser.org>
+ *
+ * This file is part of libnsutils.
+ *
+ * Licensed under the MIT License,
+ * http://www.opensource.org/licenses/mit-license.php
+ */
+
+/**
+ * \file
+ * unistd style operations.
+ */
+
+#include <unistd.h>
+#include <errno.h>
+
+#include "nsutils/unistd.h"
+
+/* exported interface documented in nsutils/unistd.h */
+ssize_t nsu_pwrite(int fd, const void *buf, size_t count, off_t offset)
+{
+#if defined(__riscos) || defined(__amiga)
+ off_t sk;
+
+ sk = lseek(fd, offset, SEEK_SET);
+ if (sk == (off_t)-1) {
+#if defined(__amiga)
+ /* amigaos cannot seek past the end of the existing file so use
+ * ftruncate to make the file long enough and retry the seek.
+ */
+ int ret;
+ if (errno == ESPIPE) {
+ ret = ftruncate(fd, offset);
+ if (ret == -1) {
+ return -1;
+ }
+ sk = lseek(fd, offset, SEEK_SET);
+ if (sk == (off_t)-1) {
+ return -1;
+ }
+ } else
+#endif
+ return -1;
+ }
+ return write(fd, buf, count);
+#else
+ return pwrite(fd, buf, count, offset);
+#endif
+}
+
+/* exported interface documented in nsutils/unistd.h */
+ssize_t nsu_pread(int fd, void *buf, size_t count, off_t offset)
+{
+#if defined(__riscos)
+ off_t sk;
+
+ sk = lseek(fd, offset, SEEK_SET);
+ if (sk == -1) {
+ return (off_t)-1;
+ }
+ return read(fd, buf, count);
+#else
+ return pread(fd, buf, count, offset);
+#endif
+
+}
--
NetSurf generalised utility library
8 years, 2 months
netsurf: branch master updated. release/3.3-38-g576b1c5
by NetSurf Browser Project
Gitweb links:
...log http://git.netsurf-browser.org/netsurf.git/shortlog/576b1c55bf5a8b37983e1...
...commit http://git.netsurf-browser.org/netsurf.git/commit/576b1c55bf5a8b37983e158...
...tree http://git.netsurf-browser.org/netsurf.git/tree/576b1c55bf5a8b37983e1581a...
The branch, master has been updated
via 576b1c55bf5a8b37983e1581a6c0cc1a9d7158f5 (commit)
from 88711495858ead8749bfcf4c08e1da49a671dd43 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=576b1c55bf5a8b37983...
commit 576b1c55bf5a8b37983e1581a6c0cc1a9d7158f5
Author: Vincent Sanders <vince(a)kyllikki.org>
Commit: Vincent Sanders <vince(a)kyllikki.org>
extend backing store logging to show errno values ofter operations
diff --git a/content/fs_backing_store.c b/content/fs_backing_store.c
index f2e6a38..638a109 100644
--- a/content/fs_backing_store.c
+++ b/content/fs_backing_store.c
@@ -1603,15 +1603,17 @@ static nserror store_write_block(struct store_state *state,
bse->elem[elem_idx].data,
bse->elem[elem_idx].size,
offst);
-
- LOG(("Wrote %d of %d bytes from %p at 0x%x block %d",
- wr, bse->elem[elem_idx].size, bse->elem[elem_idx].data,
- offst, bse->elem[elem_idx].block));
-
if (wr != (ssize_t)bse->elem[elem_idx].size) {
+ LOG(("Write failed %d of %d bytes from %p at 0x%x block %d errno %d",
+ wr, bse->elem[elem_idx].size, bse->elem[elem_idx].data,
+ offst, bse->elem[elem_idx].block, errno));
return NSERROR_SAVE_FAILED;
}
+ LOG(("Wrote %d bytes from %p at 0x%x block %d",
+ wr, bse->elem[elem_idx].data,
+ offst, bse->elem[elem_idx].block));
+
return NSERROR_OK;
}
@@ -1627,27 +1629,32 @@ static nserror store_write_file(struct store_state *state,
struct store_entry *bse,
int elem_idx)
{
- ssize_t written;
+ ssize_t wr;
int fd;
+ int err;
fd = store_open(state, bse->ident, elem_idx, O_CREAT | O_WRONLY);
if (fd < 0) {
perror("");
- LOG(("Open failed %d", fd));
+ LOG(("Open failed %d errno %d", fd, errno));
return NSERROR_SAVE_FAILED;
}
- written = write(fd, bse->elem[elem_idx].data, bse->elem[elem_idx].size);
-
- LOG(("Wrote %d of %d bytes from %p",
- written, bse->elem[elem_idx].size, bse->elem[elem_idx].data));
+ wr = write(fd, bse->elem[elem_idx].data, bse->elem[elem_idx].size);
+ err = errno; /* close can change errno */
close(fd);
- if (written < 0 || (size_t) written < bse->elem[elem_idx].size) {
+ if (wr != (ssize_t)bse->elem[elem_idx].size) {
+ LOG(("Write failed %d of %d bytes from %p errno %d",
+ wr, bse->elem[elem_idx].size, bse->elem[elem_idx].data,
+ err));
+
/** @todo Delete the file? */
return NSERROR_SAVE_FAILED;
}
+ LOG(("Wrote %d bytes from %p", wr, bse->elem[elem_idx].data));
+
return NSERROR_OK;
}
@@ -1742,6 +1749,7 @@ static nserror store_read_block(struct store_state *state,
state->blocks[elem_idx][bf].fd = store_open(state, bf, elem_idx + ENTRY_ELEM_COUNT, O_CREAT | O_RDWR);
}
if (state->blocks[elem_idx][bf].fd == -1) {
+ LOG(("Open failed errno %d", errno));
return NSERROR_SAVE_FAILED;
}
@@ -1751,15 +1759,17 @@ static nserror store_read_block(struct store_state *state,
bse->elem[elem_idx].data,
bse->elem[elem_idx].size,
offst);
-
- LOG(("Read %d of %d bytes into %p from 0x%x block %d",
- rd, bse->elem[elem_idx].size, bse->elem[elem_idx].data,
- offst, bse->elem[elem_idx].block));
-
if (rd != (ssize_t)bse->elem[elem_idx].size) {
+ LOG(("Failed reading %d of %d bytes into %p from 0x%x block %d errno %d",
+ rd, bse->elem[elem_idx].size, bse->elem[elem_idx].data,
+ offst, bse->elem[elem_idx].block, errno));
return NSERROR_SAVE_FAILED;
}
+ LOG(("Read %d bytes into %p from 0x%x block %d",
+ rd, bse->elem[elem_idx].data,
+ offst, bse->elem[elem_idx].block));
+
return NSERROR_OK;
}
@@ -1783,20 +1793,17 @@ static nserror store_read_file(struct store_state *state,
/* separate file in backing store */
fd = store_open(storestate, bse->ident, elem_idx, O_RDONLY);
if (fd < 0) {
- LOG(("Open failed"));
+ LOG(("Open failed %d errno %d", fd, errno));
/** @todo should this invalidate the entry? */
return NSERROR_NOT_FOUND;
}
- LOG(("Reading %d bytes into %p from file",
- bse->elem[elem_idx].size, bse->elem[elem_idx].data));
-
while (tot < bse->elem[elem_idx].size) {
rd = read(fd,
bse->elem[elem_idx].data + tot,
bse->elem[elem_idx].size - tot);
if (rd <= 0) {
- LOG(("read error returned %d", rd));
+ LOG(("read error returned %d errno %d", rd, errno));
ret = NSERROR_NOT_FOUND;
break;
}
@@ -1805,6 +1812,8 @@ static nserror store_read_file(struct store_state *state,
close(fd);
+ LOG(("Read %d bytes into %p", tot, bse->elem[elem_idx].data));
+
return ret;
}
-----------------------------------------------------------------------
Summary of changes:
content/fs_backing_store.c | 53 ++++++++++++++++++++++++++------------------
1 file changed, 31 insertions(+), 22 deletions(-)
diff --git a/content/fs_backing_store.c b/content/fs_backing_store.c
index f2e6a38..638a109 100644
--- a/content/fs_backing_store.c
+++ b/content/fs_backing_store.c
@@ -1603,15 +1603,17 @@ static nserror store_write_block(struct store_state *state,
bse->elem[elem_idx].data,
bse->elem[elem_idx].size,
offst);
-
- LOG(("Wrote %d of %d bytes from %p at 0x%x block %d",
- wr, bse->elem[elem_idx].size, bse->elem[elem_idx].data,
- offst, bse->elem[elem_idx].block));
-
if (wr != (ssize_t)bse->elem[elem_idx].size) {
+ LOG(("Write failed %d of %d bytes from %p at 0x%x block %d errno %d",
+ wr, bse->elem[elem_idx].size, bse->elem[elem_idx].data,
+ offst, bse->elem[elem_idx].block, errno));
return NSERROR_SAVE_FAILED;
}
+ LOG(("Wrote %d bytes from %p at 0x%x block %d",
+ wr, bse->elem[elem_idx].data,
+ offst, bse->elem[elem_idx].block));
+
return NSERROR_OK;
}
@@ -1627,27 +1629,32 @@ static nserror store_write_file(struct store_state *state,
struct store_entry *bse,
int elem_idx)
{
- ssize_t written;
+ ssize_t wr;
int fd;
+ int err;
fd = store_open(state, bse->ident, elem_idx, O_CREAT | O_WRONLY);
if (fd < 0) {
perror("");
- LOG(("Open failed %d", fd));
+ LOG(("Open failed %d errno %d", fd, errno));
return NSERROR_SAVE_FAILED;
}
- written = write(fd, bse->elem[elem_idx].data, bse->elem[elem_idx].size);
-
- LOG(("Wrote %d of %d bytes from %p",
- written, bse->elem[elem_idx].size, bse->elem[elem_idx].data));
+ wr = write(fd, bse->elem[elem_idx].data, bse->elem[elem_idx].size);
+ err = errno; /* close can change errno */
close(fd);
- if (written < 0 || (size_t) written < bse->elem[elem_idx].size) {
+ if (wr != (ssize_t)bse->elem[elem_idx].size) {
+ LOG(("Write failed %d of %d bytes from %p errno %d",
+ wr, bse->elem[elem_idx].size, bse->elem[elem_idx].data,
+ err));
+
/** @todo Delete the file? */
return NSERROR_SAVE_FAILED;
}
+ LOG(("Wrote %d bytes from %p", wr, bse->elem[elem_idx].data));
+
return NSERROR_OK;
}
@@ -1742,6 +1749,7 @@ static nserror store_read_block(struct store_state *state,
state->blocks[elem_idx][bf].fd = store_open(state, bf, elem_idx + ENTRY_ELEM_COUNT, O_CREAT | O_RDWR);
}
if (state->blocks[elem_idx][bf].fd == -1) {
+ LOG(("Open failed errno %d", errno));
return NSERROR_SAVE_FAILED;
}
@@ -1751,15 +1759,17 @@ static nserror store_read_block(struct store_state *state,
bse->elem[elem_idx].data,
bse->elem[elem_idx].size,
offst);
-
- LOG(("Read %d of %d bytes into %p from 0x%x block %d",
- rd, bse->elem[elem_idx].size, bse->elem[elem_idx].data,
- offst, bse->elem[elem_idx].block));
-
if (rd != (ssize_t)bse->elem[elem_idx].size) {
+ LOG(("Failed reading %d of %d bytes into %p from 0x%x block %d errno %d",
+ rd, bse->elem[elem_idx].size, bse->elem[elem_idx].data,
+ offst, bse->elem[elem_idx].block, errno));
return NSERROR_SAVE_FAILED;
}
+ LOG(("Read %d bytes into %p from 0x%x block %d",
+ rd, bse->elem[elem_idx].data,
+ offst, bse->elem[elem_idx].block));
+
return NSERROR_OK;
}
@@ -1783,20 +1793,17 @@ static nserror store_read_file(struct store_state *state,
/* separate file in backing store */
fd = store_open(storestate, bse->ident, elem_idx, O_RDONLY);
if (fd < 0) {
- LOG(("Open failed"));
+ LOG(("Open failed %d errno %d", fd, errno));
/** @todo should this invalidate the entry? */
return NSERROR_NOT_FOUND;
}
- LOG(("Reading %d bytes into %p from file",
- bse->elem[elem_idx].size, bse->elem[elem_idx].data));
-
while (tot < bse->elem[elem_idx].size) {
rd = read(fd,
bse->elem[elem_idx].data + tot,
bse->elem[elem_idx].size - tot);
if (rd <= 0) {
- LOG(("read error returned %d", rd));
+ LOG(("read error returned %d errno %d", rd, errno));
ret = NSERROR_NOT_FOUND;
break;
}
@@ -1805,6 +1812,8 @@ static nserror store_read_file(struct store_state *state,
close(fd);
+ LOG(("Read %d bytes into %p", tot, bse->elem[elem_idx].data));
+
return ret;
}
--
NetSurf Browser
8 years, 2 months