diff --git a/.gitignore b/.gitignore index 061fea5..bd13055 100644 --- a/.gitignore +++ b/.gitignore @@ -5,5 +5,6 @@ /libp7.so* /libp7.dll /man +/html .*.swp diff --git a/Makefile b/Makefile index 64b301f..ae02e18 100755 --- a/Makefile +++ b/Makefile @@ -15,7 +15,7 @@ mostlyclean: mostlyclean-lib mostlyclean-doc mclean: mostlyclean # Clean everything. -clean: clean-lib clean-doc +clean: clean-lib clean-doc clean-html fclean: clean # To original state. @@ -220,9 +220,9 @@ $(eval $(call make-moduleobj-rule,$(mod)))) # Make a manpage. define make-manpage-rule $(MANDIR)/man$1/%.$1: $(DOCDIR)/%.$1.txt | $(MANDIR)/man$1 - $(call bcmd,a2x,$$<,$(A2X) -f manpage -D $$| $$< 2>/dev/null) + $(call bcmd,a2x,$$@,$(A2X) -f manpage -D $$| $$< 2>/dev/null) endef -$(foreach section, $(MAN_SECTIONS), \ +$(foreach section,$(MAN_SECTIONS), \ $(eval $(call make-manpage-rule,$(section)))) # Mostly clean (do nothing, really) @@ -270,4 +270,35 @@ $(eval $(call make-uninstall-doc-rule,$(sec)))) .PHONY: all-doc mostlyclean-doc mclean-doc clean-doc re-doc .PHONY: install-doc uninstall-doc .PHONY: $(foreach s,$(MAN_SECTIONS),install-doc-$(s) uninstall-doc-$(s)) +#******************************************************************************# +# HTML documentation-related # +#******************************************************************************# +# Make all HTML files. + all-html: $(foreach s,$(MAN_SECTIONS), $(MAN_$(s):%=$(HTMLDIR)/%.$(s).html)) + +# Make the HTML directory. + $(HTMLDIR): + $(call bcmd,mkdir,$@,$(MD) $@) + +# Make an HTML page file. +define make-htmlpage-rule + $(HTMLDIR)/%.$1.html: $(DOCDIR)/%.$1.txt | $(HTMLDIR) + $(call bcmd,a2x,$$@,$(A2X) -f xhtml -D $$| $$< 2>/dev/null) +endef +$(foreach section,$(MAN_SECTIONS),\ +$(eval $(call make-htmlpage-rule,$(section)))) + +# Mostly clean (do nothing, really) + mostlyclean-html: + mclean-html: mostlyclean-html + +# Remove all built html pages. + clean-html: + $(call rmsg,Removing HTML pages directory.) + $(call qcmd,$(RM) -r $(HTMLDIR)) + +# Remake all HTML pages + re-html: clean-html all-html + +.PHONY: all-html mostlyclean-html mclean-html clean-html re-html # End of file diff --git a/Makefile.vars b/Makefile.vars index 5f9299d..114fb78 100755 --- a/Makefile.vars +++ b/Makefile.vars @@ -51,6 +51,9 @@ # Manpages directory - where the manpages will be put. MANDIR := ./man +# Web directory - where the HTML files will be put. + HTMLDIR := ./html + #******************************************************************************# # Object names, libs # #******************************************************************************# diff --git a/doc/p7_sinit.3.txt b/doc/p7_sinit.3.txt index 806a694..f6e06dd 100644 --- a/doc/p7_sinit.3.txt +++ b/doc/p7_sinit.3.txt @@ -41,13 +41,12 @@ it must be *NULL*! Otherwise, it will try to use the existing one! DESCRIPTION ----------- -This initialization function will, as the others (see *p7_init*(3)), create -a handle that other functions will use to communicate with the calculator. It -will also initiate communication and detect the environment. The difference with -the other initialization functions is that this one is used by the others, as -it creates a P7 Stream using the sent data. +This function is a more advanced version of the functions defined *p7_init*(3): +where these functions use the built-in streams, `p7_sinit` let you define your +own stream, which means *it's up to you to make the connexion between the +external device and the library*. -The *p7_stream_t* structure is the following: +The stream structure is the following: [source,c] ----