diff options
Diffstat (limited to 'system')
40 files changed, 1056 insertions, 2330 deletions
diff --git a/system/README b/system/README index 15ccfd2f84..317030373c 100644 --- a/system/README +++ b/system/README @@ -1,7 +1,7 @@ -Erlang/OTP February 18, 2010 +Erlang/OTP June 11, 2010 -LAST MINUTE INFORMATION -- Release of Erlang 5.7.5/OTP R13B04 +LAST MINUTE INFORMATION -- Release of Erlang 5.8/OTP R14A 1. GENERAL diff --git a/system/doc/Books/src/HOWTO.txt b/system/doc/Books/src/HOWTO.txt deleted file mode 100644 index 1fa47446e3..0000000000 --- a/system/doc/Books/src/HOWTO.txt +++ /dev/null @@ -1,35 +0,0 @@ -Peter H�gfeldt 2001-04-27 A - -HOWTO for building books for printing -------------------------------------- - -Note: Books are also built automatically by a daily build script. - That is the only safe way to build books. - -Note: Manual handling of dependency files has been removed. - -1. To build a book, ug say, in pdf format with a frame, be sure - to have a clean view, and run - - i) clearmake -V clean - ii) clearmake -V depend - iii) clearmake -V ug.frame.pdf - - You can build the following variants: ug.ps, ug.pdf, ug.frame.ps, - ug.frame.pdf, ug.crop.ps, and ug.crop.pdf. - - To build all frame.pdf and crop.pdf books replace iii) by - - iii) clearmake -V release_books TESTROOT=/some/dest/dir - - and you will get all books in /some/dest/dir. - -2. To change the contents of a book you have to: - - i) Edit the sgml book file, e.g. ug.sgml. - - ii) Do the corresponding changes in the Makefile (if needed). - - - - diff --git a/system/doc/Books/src/Makefile b/system/doc/Books/src/Makefile deleted file mode 100644 index 9d346cb230..0000000000 --- a/system/doc/Books/src/Makefile +++ /dev/null @@ -1,127 +0,0 @@ -# ---------------------------------------------------- -# Copyright (C) 1997, Ericsson Telecommunications -# Author: Lars Thorsen, Hans Nilsson -# ---------------------------------------------------- -include $(ERL_TOP)/make/target.mk -include $(ERL_TOP)/make/$(TARGET)/otp.mk - -# ---------------------------------------------------- -# Include dependency -# ---------------------------------------------------- - -ifeq (ug.dep,$(wildcard ug.dep)) -include ug.dep -include database_management.dep -include orber_ic.dep -include basic_application.dep -include tools.dep -include operation_maintenance.dep -include interfaces.dep -include stdlib.dep -include corba_service.dep -endif - -# ---------------------------------------------------- -# Target Specs -# ---------------------------------------------------- -BOOKS = \ - ug \ - database_management \ - orber_ic \ - corba_service \ - basic_application \ - tools \ - operation_maintenance \ - interfaces \ - stdlib - -TEX_FILES = $(shell for i in $(BOOKS) ; do (echo $$i.tex); done) - -FRAME_CROP_PDF_FILES = $(BOOKS:%=%.frame.pdf) $(BOOKS:%=%.crop.pdf) - -# ---------------------------------------------------- -# FLAGS -# ---------------------------------------------------- -XML_FLAG_booksty = -booksty otpBOOK -DVIPS_FLAGS += -O '19mm,32.5mm' - -# ---------------------------------------------------- -# Targets -# ---------------------------------------------------- - -all: $(FRAME_CROP_PDF_FILES) - -books: all - -clean: - rm -f $(TEX_FILES) - rm -f *.psframe *.pscrop *.ps - rm -f $(TOP_PS_FILES) - rm -f errs core *~ $(LATEX_CLEAN) - rm -f *.dep *.pdf - -dep depend: - @for i in $(BOOKS); do \ - echo "Running docdepend for $$i ..." ; \ - docdepend $$i.xml | \ - sed s/insidecover.tex/insidecover.xml/ > $$i.dep ; \ - done - -# ---------------------------------------------------- -# Rules -# ---------------------------------------------------- -.SUFFIXES: .psframe .pscrop - -# The following rules are for multiple suffixes, e.g. kalle.pdf, -# kalle.frame.pdf. The order of the rules is important. Default rules -# from otp.mk are disabled in order to get it right. - -%.pdf: %.ps - -%.ps: %.dvi - -%.pdf: %.dvi - -%.frame.ps: %.dvi - BOOK=$@ ./make_headers - $(DVI2PS) -frame $(DVIPS_FLAGS) -f $< > $@ - -%.frame.pdf: %.dvi - BOOK=$@ ./make_headers - $(DVI2PS) -frame $(DVIPS_FLAGS) -f $< | \ - $(DISTILL) $(DISTILL_FLAGS) > $@ - -%.crop.ps: %.dvi - BOOK=$@ ./make_headers - $(DVI2PS) -crop $(DVIPS_FLAGS) -f $< > $@ - -%.crop.pdf: %.dvi - BOOK=$@ ./make_headers - $(DVI2PS) -crop $(DVIPS_FLAGS) -f $< | \ - $(DISTILL) $(DISTILL_FLAGS) > $@ - -%.pdf: %.dvi - $(DVI2PS) $(DVIPS_FLAGS) -f $< | \ - $(DISTILL) $(DISTILL_FLAGS) > $@ - -%.ps: %.dvi - $(DVI2PS) $(DVIPS_FLAGS) -f $< > $@ - -%.pdf: %.dvi - $(DVI2PS) $(DVIPS_FLAGS) -f $< | \ - $(DISTILL) $(DISTILL_FLAGS) > $@ - -# ---------------------------------------------------- -# Release targets -# ---------------------------------------------------- -# - -ifeq ($(TESTROOT),) -release_books: all - -else -release_books: all - $(INSTALL_DIR) $(TESTROOT)/books - $(INSTALL_DATA) $(FRAME_CROP_PDF_FILES) $(TESTROOT)/books -endif - diff --git a/system/doc/Books/src/basic_application.xml b/system/doc/Books/src/basic_application.xml deleted file mode 100644 index 8097dafd7e..0000000000 --- a/system/doc/Books/src/basic_application.xml +++ /dev/null @@ -1,107 +0,0 @@ -<?xml version="1.0" encoding="latin1" ?> -<!DOCTYPE book SYSTEM "book.dtd"> - -<book> - <header titlestyle="special"> - <copyright> - <year>2000</year> - <year>2007</year> - <holder>Ericsson AB, All Rights Reserved</holder> - </copyright> - <legalnotice> - The contents of this file are subject to the Erlang Public License, - Version 1.1, (the "License"); you may not use this file except in - compliance with the License. You should have received a copy of the - Erlang Public License along with this software. If not, it can be - retrieved online at http://www.erlang.org/. - - Software distributed under the License is distributed on an "AS IS" - basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See - the License for the specific language governing rights and limitations - under the License. - - The Initial Developer of the Original Code is Ericsson AB. - </legalnotice> - - <title>Erlang 5.1/OTP R8 Run-Time System and Basic Applications</title> - <prepared>Bengt Nilsson</prepared> - <docno></docno> - <date>2000-10-17</date> - <rev></rev> - </header> - <insidecover> - <include file="insidecover"></include> - </insidecover> - <pagetext>Erlang/OTP Run-Time System and Basic Applications</pagetext> - <preamble> - <contents level="2"></contents> - <preface> - <p><em>Introduction</em> <br></br> -This documentation describes the Open - Telecom Platform (Erlang/OTP), a middle-ware based on the Erlang - programming language, aiming at providing time-saving and flexible - development for robust, adaptable telecom systems.</p> - <p><em>Organization of the Documentation</em> <br></br> - - The documentation is divided into eight parts:</p> - <list type="bulleted"> - <item>Erlang 5.0/OTP R7 System Documentation, EN/LZT 1084095 R1</item> - <item>Erlang 5.0/OTP R7 Run-Time System and Basic Applications, - EN/LZT 108 4106 R1</item> - <item>Erlang 5.0/OTP R7 Standard Library Application, EN/LZT 108 4107 - R1</item> - <item>Erlang 5.0/OTP R7 Database Applications, EN/LZT 108 194 R3</item> - <item>Erlang 5.0/OTP R7 CORBA and IDL Applications, - EN/LZT 151 810 R2</item> - <item>Erlang 5.0/OTP R7 Interface and Communication Applications, - EN/LZT 108 4110 R1</item> - <item>Erlang 5.0/OTP R7 Operation and Maintenance Applications, - EN/LZT 108 4108 R1</item> - <item>Erlang 5.0/OTP R7 Tool Applications, EN/LZT 108 4109 R1</item> - </list> - <p><em>About this Book</em> <br></br> -This book is a collection of User's Guides for</p> - <list type="bulleted"> - <item>ERTS</item> - <item>SASL</item> - </list> - <p>and of Reference Manuals for</p> - <list type="bulleted"> - <item>ERTS</item> - <item>SASL</item> - <item>Compiler</item> - <item>Kernel</item> - </list> - <p>The Standard Libraries (STDLIB), which are in close - connection with Kernel, are documented in a volume of its - own.</p> - <br></br> - </preface> - </preamble> - <pagetext>ERTS</pagetext> - <parts lift="no"> - <title>ERTS User's Guide</title> - <include file="../../../../erts/erts/doc/src/part"></include> - </parts> - <applications> - <include file="../../../../erts/erts/doc/src/application"></include> - </applications> - <pagetext>SASL</pagetext> - <parts lift="no"> - <title>SASL User's Guide</title> - <include file="../../../../erts/lib/sasl/doc/src/part"></include> - </parts> - <applications> - <include file="../../../../erts/lib/sasl/doc/src/application"></include> - </applications> - <pagetext>Kernel</pagetext> - <applications> - <include file="../../../../erts/lib/kernel/doc/src/application_holder"></include> - </applications> - <pagetext>Compiler</pagetext> - <applications> - <include file="../../../../erts/lib/compiler/doc/src/application"></include> - </applications> - <pagetext>Erlang/OTP Run-Time System and Basic Applications</pagetext> -</book> - diff --git a/system/doc/Books/src/corba_service.xml b/system/doc/Books/src/corba_service.xml deleted file mode 100644 index dce2894a52..0000000000 --- a/system/doc/Books/src/corba_service.xml +++ /dev/null @@ -1,137 +0,0 @@ -<?xml version="1.0" encoding="latin1" ?> -<!DOCTYPE book SYSTEM "book.dtd"> - -<book> - <header titlestyle="special"> - <copyright> - <year>2001</year> - <year>2007</year> - <holder>Ericsson AB, All Rights Reserved</holder> - </copyright> - <legalnotice> - The contents of this file are subject to the Erlang Public License, - Version 1.1, (the "License"); you may not use this file except in - compliance with the License. You should have received a copy of the - Erlang Public License along with this software. If not, it can be - retrieved online at http://www.erlang.org/. - - Software distributed under the License is distributed on an "AS IS" - basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See - the License for the specific language governing rights and limitations - under the License. - - The Initial Developer of the Original Code is Ericsson AB. - </legalnotice> - - <title>Erlang 5.1/OTP R8 CORBA Services </title> - <prepared></prepared> - <docno>EN/LZT 151 ??? R1</docno> - <date>1997-05-27</date> - <rev></rev> - <abbreviation></abbreviation> - </header> - <insidecover> - <include file="insidecover"></include> - </insidecover> - <pagetext>Erlang/OTP CORBA Services</pagetext> - <preamble> - <contents level="2"></contents> - <preface> - <p><em>Introduction</em> <br></br> - - This documentation describes the Open - Telecom Platform (Erlang/OTP), a middle-ware based on the Erlang - programming language, aiming at providing time-saving and flexible - development for robust, adaptable telecom systems.</p> - <p><em>Organization of the Documentation</em> <br></br> - - The documentation is divided into eight parts:</p> - <list type="bulleted"> - <item>Erlang 5.0/OTP R7 System Documentation, EN/LZT 1084095 R1</item> - <item>Erlang 5.0/OTP R7 Run-Time System and Basic Applications, - EN/LZT 108 4106 R1</item> - <item>Erlang 5.0/OTP R7 Standard Library Application, EN/LZT 108 4107 - R1</item> - <item>Erlang 5.0/OTP R7 Database Applications, EN/LZT 108 194 R3</item> - <item>Erlang 5.0/OTP R7 CORBA and IDL Applications, - EN/LZT 151 810 R2</item> - <item>Erlang 5.0/OTP R7 Interface and Communication Applications, - EN/LZT 108 4110 R1</item> - <item>Erlang 5.0/OTP R7 Operation and Maintenance Applications, - EN/LZT 108 4108 R1</item> - <item>Erlang 5.0/OTP R7 Tool Applications, EN/LZT 108 4109 R1</item> - </list> - <p><em>About this Book</em> <br></br> -</p> - <p>This book contains documentation about the six applications in Erlang/OTP that - implement the CORBA services. - These applications are:</p> - <list type="bulleted"> - <item><em>cosEvent</em>, an Erlang implementation of the - CORBA service CosEvent.</item> - <item><em>cosEventDomain</em>, an Erlang implementation of the - CORBA service CosEventDomainAdmin.</item> - <item><em>cosFileTransfer</em>, an Erlang implementation of the - CORBA service CosFileTransfer.</item> - <item><em>cosNotificaton</em>, an Erlang implementation of the - CORBA service CosNotification.</item> - <item><em>cosProperty</em>, an Erlang implementation of the - CORBA service CosProperty.</item> - <item><em>cosTime</em>, an Erlang implementation of the - CORBA service CosTime.</item> - <item><em>cosTransaction</em>, an Erlang implementation of the - CORBA service CosTransaction.</item> - </list> - </preface> - </preamble> - <pagetext>cosEvent</pagetext> - <parts lift="no"> - <title>cosEvent User's Guide</title> - <include file="../../../../libraries/cosEvent/doc/src/part"></include> - </parts> - <applications> - <include file="../../../../libraries/cosEvent/doc/src/application"></include> - </applications> - <pagetext>cosEventDomain</pagetext> - <parts lift="no"> - <title>cosEventDomain User's Guide</title> - <include file="../../../../libraries/cosEventDomain/doc/src/part"></include> - </parts> - <applications> - <include file="../../../../libraries/cosEventDomain/doc/src/application"></include> - </applications> - <pagetext>cosFileTransfert</pagetext> - <parts lift="no"> - <title>cosFileTransfer User's Guide</title> - <include file="../../../../libraries/cosFileTransfer/doc/src/part"></include> - </parts> - <applications> - <include file="../../../../libraries/cosFileTransfer/doc/src/application"></include> - </applications> - <pagetext>cosNotification</pagetext> - <parts lift="no"> - <title>cosNotification User's Guide</title> - <include file="../../../../libraries/cosNotification/doc/src/part"></include> - </parts> - <applications> - <include file="../../../../libraries/cosNotification/doc/src/application"></include> - </applications> - <pagetext>cosTime</pagetext> - <parts lift="no"> - <title>cosTime User's Guide</title> - <include file="../../../../libraries/cosTime/doc/src/part"></include> - </parts> - <applications> - <include file="../../../../libraries/cosTime/doc/src/application"></include> - </applications> - <pagetext>cosProperty</pagetext> - <parts lift="no"> - <title>cosProperty User's Guide</title> - <include file="../../../../libraries/cosProperty/doc/src/part"></include> - </parts> - <applications> - <include file="../../../../libraries/cosProperty/doc/src/application"></include> - </applications> - <pagetext>Erlang/OTP CORBA Services</pagetext> -</book> - diff --git a/system/doc/Books/src/database_management.xml b/system/doc/Books/src/database_management.xml deleted file mode 100644 index 268612a990..0000000000 --- a/system/doc/Books/src/database_management.xml +++ /dev/null @@ -1,118 +0,0 @@ -<?xml version="1.0" encoding="latin1" ?> -<!DOCTYPE book SYSTEM "book.dtd"> - -<book> - <header titlestyle="special"> - <copyright> - <year>1997</year> - <year>2007</year> - <holder>Ericsson AB, All Rights Reserved</holder> - </copyright> - <legalnotice> - The contents of this file are subject to the Erlang Public License, - Version 1.1, (the "License"); you may not use this file except in - compliance with the License. You should have received a copy of the - Erlang Public License along with this software. If not, it can be - retrieved online at http://www.erlang.org/. - - Software distributed under the License is distributed on an "AS IS" - basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See - the License for the specific language governing rights and limitations - under the License. - - The Initial Developer of the Original Code is Ericsson AB. - </legalnotice> - - <title>Erlang 5.1/OTP R8 Database Applications </title> - <prepared></prepared> - <docno>EN/LZT 108 194 R2</docno> - <date>1997-05-27</date> - <rev></rev> - <abbreviation></abbreviation> - </header> - <insidecover> - <include file="insidecover"></include> - </insidecover> - <pagetext>Erlang/OTP Database Applications</pagetext> - <preamble> - <contents level="2"></contents> - <preface> - <p><em>Introduction</em> <br></br> -This documentation describes the Open - Telecom Platform (Erlang/OTP), a middle-ware based on the Erlang - programming language, aiming at providing time-saving and flexible - development for robust, adaptable telecom systems.</p> - <p><em>Organization of the Documentation</em> <br></br> - - The documentation is divided into eight parts:</p> - <list type="bulleted"> - <item>Erlang 5.0/OTP R7 System Documentation, EN/LZT 1084095 R1</item> - <item>Erlang 5.0/OTP R7 Run-Time System and Basic Applications, - EN/LZT 108 4106 R1</item> - <item>Erlang 5.0/OTP R7 Standard Library Application, EN/LZT 108 4107 - R1</item> - <item>Erlang 5.0/OTP R7 Database Applications, EN/LZT 108 194 R3</item> - <item>Erlang 5.0/OTP R7 CORBA and IDL Applications, - EN/LZT 151 810 R2</item> - <item>Erlang 5.0/OTP R7 Interface and Communication Applications, - EN/LZT 108 4110 R1</item> - <item>Erlang 5.0/OTP R7 Operation and Maintenance Applications, - EN/LZT 108 4108 R1</item> - <item>Erlang 5.0/OTP R7 Tool Applications, EN/LZT 108 4109 R1</item> - </list> - <p><em>About this Book</em> <br></br> -</p> - <p>This book is common for the four applications in Erlang/OTP, which - manage databases. These applications are:</p> - <list type="bulleted"> - <item><em>Mnesia</em>; to be used when - a continuous - operation and soft real-time properties are required.</item> - <item><em>Mnesia_Session</em>; to be used when the Mnesia Database - Management - System has to be accessed from other programming languages than - Erlang.</item> - <item><em>Mnemosyne</em>; to be used as a query language for the - Mnesia Database - Management System. </item> - <item><em>ODBC,</em> Open DataBase Connectivity; to be used when - various SQL - databases will be accessed.</item> - </list> - </preface> - </preamble> - <pagetext>Mnesia</pagetext> - <parts lift="no"> - <title>Mnesia User's Guide</title> - <include file="../../../../libraries/mnesia/doc/src/part"></include> - </parts> - <applications> - <include file="../../../../libraries/mnesia/doc/src/application"></include> - </applications> - <pagetext>Mnesia_Session</pagetext> - <parts lift="no"> - <title>Mnesia_Session User's Guide</title> - <include file="../../../../libraries/mnesia_session/doc/src/part"></include> - </parts> - <applications> - <include file="../../../../libraries/mnesia_session/doc/src/application"></include> - </applications> - <pagetext>Mnemosyne</pagetext> - <parts lift="no"> - <title>Mnemosyne User's Guide</title> - <include file="../../../../libraries/mnemosyne/doc/src/part"></include> - </parts> - <applications> - <include file="../../../../libraries/mnemosyne/doc/src/application"></include> - </applications> - <pagetext>ODBC </pagetext> - <parts lift="no"> - <title>ODBC User's Guide</title> - <include file="../../../../libraries/odbc/doc/src/part"></include> - </parts> - <applications> - <include file="../../../../libraries/odbc/doc/src/application"></include> - </applications> - <pagetext>Erlang/OTP Database Applications</pagetext> -</book> - diff --git a/system/doc/Books/src/frame_crop.header.src b/system/doc/Books/src/frame_crop.header.src deleted file mode 100644 index 131045ef8d..0000000000 --- a/system/doc/Books/src/frame_crop.header.src +++ /dev/null @@ -1,101 +0,0 @@ -%% This PostScript file centers the page on an A4 paper and draws a -%% crop marks. dvips is assumed. - -%% DEBUG -%% /mydict 20 dict def mydict begin - -%% Millimeter to postscript points: - -/mm{ 25.4 div 72 mul }def - - -%% The size of the retangle is: - -/papw 172 mm def -/paph 232 mm def - -%% The text area size is: - -%%/txtw{131 mm}def -%%/txth{285 mm}def - - -%% A4 size is: - -/A4w 209 mm def -/A4h 296 mm def - -%% Draw crop marks - -/mkcrop{ - 0.3 setlinewidth - 0 0 mkonecrop - papw 0 mkonecrop - 0 paph mkonecrop - papw paph mkonecrop -} def - -/mkonecrop{gsave - translate - newpath - 0 18 moveto - 0 -18 lineto - stroke - newpath - -18 0 moveto - 18 0 lineto - stroke - grestore } def - -%% Draw a frame - -/mkframe{ - gsave - 0 A4h paph sub moveto - papw 0 rlineto - 0 paph rlineto - papw neg 0 rlineto - 0 paph neg rlineto - stroke - grestore -} def - -/mkmarks{mk@MARKS@} def - -/mkinfo{ gsave - 72 68 moveto (Book: @BOOK@) show - 72 60 moveto (Generated by dvips: @DATE@) show - 72 52 moveto (Config spec: @CSFILE@) show - 72 44 moveto (View: @VIEW@) show - 72 36 moveto (User: @USER@) show - 72 28 moveto (Latex: @LATEX@) show - 72 20 moveto (@DOCBVSN@ @DOCB@) show - 72 12 moveto (@DVIPSVSN@ @DVIPS@) show - 288 68 moveto (Book build: @BOOKBUILD@) show - 288 60 moveto (Build script: @BUILDSCRIPT@) show - grestore -} def - - -%% Beginning-of-page hook (the thing called by dvips): - -/bop-hook{ - gsave - /Helvetica findfont 7 scalefont setfont - gsave - A4w papw sub 2 div - A4h paph sub 2 div neg - translate - mkmarks - grestore - mkinfo - grestore -} def - -%% DEBUG -%%/bop-hook -%%showpage -%%end - - - diff --git a/system/doc/Books/src/insidecover.xml b/system/doc/Books/src/insidecover.xml deleted file mode 100644 index e6b4b4206c..0000000000 --- a/system/doc/Books/src/insidecover.xml +++ /dev/null @@ -1,35 +0,0 @@ -<?xml version="1.0" encoding="latin1" ?> -<!DOCTYPE bookinsidecover SYSTEM "bookinsidecover.dtd"> - -<bookinsidecover> -Ericsson Utvecklings AB provides this publication ``as is'' without warranty of any kind. In no event shall Ericsson Utvecklings AB be liable for any damage arising from any defect or error in this publication. The contents of this publication is subject to revision without notice due to continued progress in design. <br></br> - <br></br> -Copyright © 1996-2000 Ericsson Utvecklings AB. <br></br> - <br></br> -All rights reserved including the right of reproduction in whole or in part in any form. <br></br> - <vfill></vfill> - <br></br> - <bold>Editors & Layout:</bold> -Anna Fedoriw and Bengt Nilsson <br></br> - <bold>Written and Produced by:</bold> -The Open Telecom Platform Project <br></br> - <bold>Cover by:</bold> -Röjning & Co <br></br> - <br></br> -Fourth revised and restructured edition. <br></br> - <br></br> -Printed in Sweden by XBS Koncerntryck, Stockholm 2000 <br></br> - <br></br> - <vfill></vfill> - <br></br> -For more information: URL <tt>http://www.erlang.se</tt> - <br></br> - <br></br> - <br></br> -Ericsson Utvecklings AB <br></br> -OTP Product Development <br></br> -Box 1505 <br></br> -SE-125 25 ÄLVSJÖ <br></br> -Sweden <br></br> -</bookinsidecover> - diff --git a/system/doc/Books/src/interfaces.xml b/system/doc/Books/src/interfaces.xml deleted file mode 100644 index b225f9581a..0000000000 --- a/system/doc/Books/src/interfaces.xml +++ /dev/null @@ -1,144 +0,0 @@ -<?xml version="1.0" encoding="latin1" ?> -<!DOCTYPE book SYSTEM "book.dtd"> - -<book> - <header titlestyle="special"> - <copyright> - <year>2000</year> - <year>2007</year> - <holder>Ericsson AB, All Rights Reserved</holder> - </copyright> - <legalnotice> - The contents of this file are subject to the Erlang Public License, - Version 1.1, (the "License"); you may not use this file except in - compliance with the License. You should have received a copy of the - Erlang Public License along with this software. If not, it can be - retrieved online at http://www.erlang.org/. - - Software distributed under the License is distributed on an "AS IS" - basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See - the License for the specific language governing rights and limitations - under the License. - - The Initial Developer of the Original Code is Ericsson AB. - </legalnotice> - - <title>Erlang 5.1/OTP R8 Interface and Communication Applications</title> - <prepared>Bengt Nilsson</prepared> - <docno></docno> - <date>2000-02-09</date> - <rev></rev> - </header> - <insidecover> - <include file="insidecover"></include> - </insidecover> - <pagetext>Erlang/OTP Interface and Communication </pagetext> - <preamble> - <contents level="2"></contents> - <preface> - <p><em>Introduction</em> <br></br> -This documentation describes the Open - Telecom Platform (Erlang/OTP), a middle-ware based on the Erlang - programming language, aiming at providing time-saving and flexible - development for robust, adaptable telecom systems.</p> - <p><em>Organization of the Documentation</em> <br></br> - - The documentation is divided into eight parts:</p> - <list type="bulleted"> - <item>Erlang 5.0/OTP R7 System Documentation, EN/LZT 1084095 R1</item> - <item>Erlang 5.0/OTP R7 Run-Time System and Basic Applications, - EN/LZT 108 4106 R1</item> - <item>Erlang 5.0/OTP R7 Standard Library Application, EN/LZT 108 4107 - R1</item> - <item>Erlang 5.0/OTP R7 Database Applications, EN/LZT 108 194 R3</item> - <item>Erlang 5.0/OTP R7 CORBA and IDL Applications, - EN/LZT 151 810 R2</item> - <item>Erlang 5.0/OTP R7 Interface and Communication Applications, - EN/LZT 108 4110 R1</item> - <item>Erlang 5.0/OTP R7 Operation and Maintenance Applications, - EN/LZT 108 4108 R1</item> - <item>Erlang 5.0/OTP R7 Tool Applications, EN/LZT 108 4109 R1</item> - </list> - <p><em>About this Book</em> <br></br> -</p> - <p>This book is a collection of the documentation of following applications:</p> - <list type="bulleted"> - <item>Asn1</item> - <item>Comet</item> - <item>Crypto</item> - <item>Erl_Interface</item> - <item>GS</item> - <item>Inets</item> - <item>Jinterface</item> - <item>Megaco</item> - <item>SSL</item> - </list> - </preface> - </preamble> - <pagetext>Asn1</pagetext> - <parts lift="yes"> - <title>Asn1 User's Guide</title> - <include file="../../../../erts/lib/asn1/doc/src/part"></include> - </parts> - <applications> - <include file="../../../../erts/lib/asn1/doc/src/application"></include> - </applications> - <pagetext>Comet </pagetext> - <parts lift="no"> - <title>Comet User's Guide</title> - <include file="../../../../erts/lib/comet/doc/src/users_guide"></include> - </parts> - <applications> - <include file="../../../../erts/lib/comet/doc/src/refman"></include> - </applications> - <pagetext>Crypto</pagetext> - <applications> - <include file="../../../../erts/lib/crypto/doc/src/refman"></include> - </applications> - <pagetext>Erl_Interface</pagetext> - <parts lift="yes"> - <title>Erl_Interface User's Guide</title> - <include file="../../../../erts/lib/erl_interface/doc/src/part_erl_interface"></include> - </parts> - <applications> - <include file="../../../../erts/lib/erl_interface/doc/src/application_erl_interface"></include> - </applications> - <pagetext>GS</pagetext> - <parts lift="no"> - <title>GS User's Guide</title> - <include file="../../../../erts/lib/gs/doc/src/part"></include> - </parts> - <applications> - <include file="../../../../erts/lib/gs/doc/src/application"></include> - </applications> - <pagetext>Inets</pagetext> - <applications> - <include file="../../../../libraries/inets/doc/src/application"></include> - </applications> - <pagetext>Jinterface </pagetext> - <parts lift="yes"> - <title>Jinterface User's Guide</title> - <include file="../../../../erts/lib/jinterface/doc/src/part"></include> - </parts> - <applications> - <include file="../../../../erts/lib/jinterface/doc/src/application"></include> - </applications> - <pagetext>Megaco</pagetext> - <parts lift="no"> - <title>Megaco User's Guide</title> - <include file="../../../../erts/lib/megaco/doc/src/part"></include> - </parts> - <applications> - <include file="../../../../erts/lib/megaco/doc/src/application"></include> - </applications> - <pagetext>SSL </pagetext> - <parts lift="yes"> - <title>SSL Users Guide</title> - <include file="../../../../erts/lib/ssl/doc/src/part"></include> - </parts> - <applications> - <include file="../../../../erts/lib/ssl/doc/src/refman"></include> - </applications> - <pagetext>Erlang/OTP Interface and Communication </pagetext> -</book> - diff --git a/system/doc/Books/src/make_headers b/system/doc/Books/src/make_headers deleted file mode 100755 index 0ec7aca632..0000000000 --- a/system/doc/Books/src/make_headers +++ /dev/null @@ -1,30 +0,0 @@ -#!/bin/sh -# -# Make Postscript header files (frame and crop marks) -# -# From environment: BOOK CSFILE USER BOOKBUILD - -DATE=`date` -VIEW=`cleartool pwv -s -set` -LATEX=`which latex` -DVIPSVSN=`dvips -version` -DVIPS=`which dvips` -DOCBVSN=`docb_transform -version` -DOCB=`which docb_transform` -for marks in frame crop; do - sed -e "s/@DATE@/$DATE/g" \ - -e "s/@BOOK@/$BOOK/g" \ - -e "s/@MARKS@/$marks/g" \ - -e "s;@CSFILE@;$CSFILE;g" \ - -e "s/@VIEW@/$VIEW/g" \ - -e "s/@USER@/$USER/g" \ - -e "s;@LATEX@;$LATEX;g" \ - -e "s;@DVIPSVSN@;$DVIPSVSN;g" \ - -e "s;@DVIPS@;$DVIPS;g" \ - -e "s/@DOCBVSN@/$DOCBVSN/g" \ - -e "s;@DOCB@;$DOCB;g" \ - -e "s;@BOOKBUILD@;$BOOKBUILD;g" \ - -e "s;@BUILDSCRIPT@;$BUILDSCRIPT;g" \ - frame_crop.header.src > $marks.header -done - diff --git a/system/doc/Books/src/operation_maintenance.xml b/system/doc/Books/src/operation_maintenance.xml deleted file mode 100644 index 41bdd3dff7..0000000000 --- a/system/doc/Books/src/operation_maintenance.xml +++ /dev/null @@ -1,94 +0,0 @@ -<?xml version="1.0" encoding="latin1" ?> -<!DOCTYPE book SYSTEM "book.dtd"> - -<book> - <header titlestyle="special"> - <copyright> - <year>2000</year> - <year>2007</year> - <holder>Ericsson AB, All Rights Reserved</holder> - </copyright> - <legalnotice> - The contents of this file are subject to the Erlang Public License, - Version 1.1, (the "License"); you may not use this file except in - compliance with the License. You should have received a copy of the - Erlang Public License along with this software. If not, it can be - retrieved online at http://www.erlang.org/. - - Software distributed under the License is distributed on an "AS IS" - basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See - the License for the specific language governing rights and limitations - under the License. - - The Initial Developer of the Original Code is Ericsson AB. - </legalnotice> - - <title>Erlang 5.1/OTP R8 Operation and Maintenance Applications</title> - <prepared>Bengt Nilsson</prepared> - <docno></docno> - <date>2000-02-09</date> - <rev></rev> - </header> - <insidecover> - <include file="insidecover"></include> - </insidecover> - <pagetext>Erlang/OTP Operation and Maintenance</pagetext> - <preamble> - <contents level="2"></contents> - <preface> - <p><em>Introduction</em> <br></br> -This documentation describes the Open - Telecom Platform (Erlang/OTP), a middle-ware based on the Erlang - programming language, aiming at providing time-saving and flexible - development for robust, adaptable telecom systems.</p> - <p><em>Organization of the Documentation</em> <br></br> -the documentation is - divided into eight parts:</p> - <list type="bulleted"> - <item>Erlang 5.0/OTP R7 System Documentation, EN/LZT 1084095 R1</item> - <item>Erlang 5.0/OTP R7 Run-Time System and Basic Applications, - EN/LZT 108 4106 R1</item> - <item>Erlang 5.0/OTP R7 Standard Library Application, EN/LZT 108 4107 R1</item> - <item>Erlang 5.0/OTP R7 Database Applications, EN/LZT 108 194 R3</item> - <item>Erlang 5.0/OTP R7 CORBA and IDL Applications, - EN/LZT 151 810 R2</item> - <item>Erlang 5.0/OTP R7 Interface and Communication Applications, - EN/LZT 108 4110 R1</item> - <item>Erlang 5.0/OTP R7 Operation and Maintenance Applications, - EN/LZT 108 4108 R1</item> - <item>Erlang 5.0/OTP R7 Tool Applications, EN/LZT 108 4109 R1</item> - </list> - <p><em>About this Book</em> <br></br> - - This book is a collection of Erlang application used during Operation and Maintenance. The following applications are covered:</p> - <list type="bulleted"> - <item>EVA</item> - <item>OS_Mon </item> - <item>SNMP</item> - </list> - </preface> - </preamble> - <pagetext>EVA</pagetext> - <parts lift="no"> - <title>EVA User's Guide</title> - <include file="../../../../libraries/eva/doc/src/users_guide"></include> - </parts> - <applications> - <include file="../../../../libraries/eva/doc/src/refman"></include> - <include file="../../../../libraries/eva/doc/src/refman_snmp"></include> - </applications> - <pagetext>OS_Mon</pagetext> - <applications> - <include file="../../../../erts/lib/os_mon/doc/src/application"></include> - </applications> - <pagetext>SNMP</pagetext> - <parts lift="no"> - <title>SNMP User's Guide</title> - <include file="../../../../libraries/snmp/doc/src/part"></include> - </parts> - <applications> - <include file="../../../../libraries/snmp/doc/src/application"></include> - </applications> - <pagetext>Erlang/OTP Operation and Maintenance</pagetext> -</book> - diff --git a/system/doc/Books/src/orber_ic.xml b/system/doc/Books/src/orber_ic.xml deleted file mode 100644 index 16eb076dc7..0000000000 --- a/system/doc/Books/src/orber_ic.xml +++ /dev/null @@ -1,112 +0,0 @@ -<?xml version="1.0" encoding="latin1" ?> -<!DOCTYPE book SYSTEM "book.dtd"> - -<book> - <header titlestyle="special"> - <copyright> - <year>1999</year> - <year>2007</year> - <holder>Ericsson AB, All Rights Reserved</holder> - </copyright> - <legalnotice> - The contents of this file are subject to the Erlang Public License, - Version 1.1, (the "License"); you may not use this file except in - compliance with the License. You should have received a copy of the - Erlang Public License along with this software. If not, it can be - retrieved online at http://www.erlang.org/. - - Software distributed under the License is distributed on an "AS IS" - basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See - the License for the specific language governing rights and limitations - under the License. - - The Initial Developer of the Original Code is Ericsson AB. - </legalnotice> - - <title>Erlang 5.1/OTP R8 CORBA and IDL Applications </title> - <prepared></prepared> - <docno>EN/LZT 151 810 R1</docno> - <date>1997-05-27</date> - <rev></rev> - <abbreviation></abbreviation> - </header> - <insidecover> - <include file="insidecover"></include> - </insidecover> - <pagetext>Erlang/OTP CORBA and IDL</pagetext> - <preamble> - <contents level="2"></contents> - <preface> - <p><em>Introduction</em> <br></br> - - This documentation describes the Open - Telecom Platform (Erlang/OTP), a middle-ware based on the Erlang - programming language, aiming at providing time-saving and flexible - development for robust, adaptable telecom systems.</p> - <p><em>Organization of the Documentation</em> <br></br> - - The documentation is divided into eight parts:</p> - <list type="bulleted"> - <item>Erlang 5.0/OTP R7 System Documentation, EN/LZT 1084095 R1</item> - <item>Erlang 5.0/OTP R7 Run-Time System and Basic Applications, - EN/LZT 108 4106 R1</item> - <item>Erlang 5.0/OTP R7 Standard Library Application, EN/LZT 108 4107 - R1</item> - <item>Erlang 5.0/OTP R7 Database Applications, EN/LZT 108 194 R3</item> - <item>Erlang 5.0/OTP R7 CORBA and IDL Applications, - EN/LZT 151 810 R2</item> - <item>Erlang 5.0/OTP R7 Interface and Communication Applications, - EN/LZT 108 4110 R1</item> - <item>Erlang 5.0/OTP R7 Operation and Maintenance Applications, - EN/LZT 108 4108 R1</item> - <item>Erlang 5.0/OTP R7 Tool Applications, EN/LZT 108 4109 R1</item> - </list> - <p><em>About this Book</em> <br></br> -</p> - <p>This book contains documentation about the six applications in Erlang/OTP that - implement the CORBA standard. - These applications are:</p> - <list type="bulleted"> - <item> - <p><em>IC</em>, a compiler for OMG Interface Definition - Language (IDL). - The OMG IDL is used for - language-independent interface specifications.</p> - <p>The compiler - is capable of producing;</p> - <list type="bulleted"> - <item>Erlang stub/skeleton code for CORBA (default behavior)</item> - <item>Erlang stub/skeleton code for OTP generic servers</item> - <item>C stub/skeleton code for OTP generic servers</item> - <item>Java stub/skeleton code for OTP generic servers</item> - <item>Erlang code for module interfaces</item> - </list> - </item> - <item><em>Orber</em>, which is an Object Request Broker that can be - used for - accessing distributed services in an - soft real-time environment. It is especially useful for applications - that use a heterogeneous - language environments.</item> - </list> - </preface> - </preamble> - <pagetext>IC</pagetext> - <parts lift="no"> - <title>IC User's Guide </title> - <include file="../../../../libraries/ic/doc/src/part"></include> - </parts> - <applications> - <include file="../../../../libraries/ic/doc/src/application"></include> - </applications> - <pagetext>Orber</pagetext> - <parts lift="no"> - <title>Orber User's Guide</title> - <include file="../../../../libraries/orber/doc/src/part"></include> - </parts> - <applications> - <include file="../../../../libraries/orber/doc/src/application"></include> - </applications> - <pagetext>Erlang/OTP CORBA and IDL</pagetext> -</book> - diff --git a/system/doc/Books/src/stdlib.xml b/system/doc/Books/src/stdlib.xml deleted file mode 100644 index 31ea0d6962..0000000000 --- a/system/doc/Books/src/stdlib.xml +++ /dev/null @@ -1,73 +0,0 @@ -<?xml version="1.0" encoding="latin1" ?> -<!DOCTYPE book SYSTEM "book.dtd"> - -<book> - <header titlestyle="special"> - <copyright> - <year>2000</year> - <year>2007</year> - <holder>Ericsson AB, All Rights Reserved</holder> - </copyright> - <legalnotice> - The contents of this file are subject to the Erlang Public License, - Version 1.1, (the "License"); you may not use this file except in - compliance with the License. You should have received a copy of the - Erlang Public License along with this software. If not, it can be - retrieved online at http://www.erlang.org/. - - Software distributed under the License is distributed on an "AS IS" - basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See - the License for the specific language governing rights and limitations - under the License. - - The Initial Developer of the Original Code is Ericsson AB. - </legalnotice> - - <title>Erlang 5.1/OTP R8 Standard Library Application</title> - <prepared>Bengt Nilsson</prepared> - <docno></docno> - <date>2000-05-30</date> - <rev></rev> - </header> - <insidecover> - <include file="insidecover"></include> - </insidecover> - <pagetext>Erlang/OTP Standard Library Application</pagetext> - <preamble> - <contents level="2"></contents> - <preface> - <p><em>Introduction</em> <br></br> -This documentation describes the Open - Telecom Platform (Erlang/OTP), a middle-ware based on the Erlang - programming language, aiming at providing time-saving and flexible - development for robust, adaptable telecom systems.</p> - <p><em>Organization of the Documentation</em> <br></br> - - The documentation is divided into eight parts:</p> - <list type="bulleted"> - <item>Erlang 5.0/OTP R7 System Documentation, EN/LZT 1084095 R1</item> - <item>Erlang 5.0/OTP R7 Run-Time System and Basic Applications, - EN/LZT 108 4106 R1</item> - <item>Erlang 5.0/OTP R7 Standard Library Application, EN/LZT 108 4107 - R1</item> - <item>Erlang 5.0/OTP R7 Database Applications, EN/LZT 108 194 R3</item> - <item>Erlang 5.0/OTP R7 CORBA and IDL Applications, - EN/LZT 151 810 R2</item> - <item>Erlang 5.0/OTP R7 Interface and Communication Applications, - EN/LZT 108 4110 R1</item> - <item>Erlang 5.0/OTP R7 Operation and Maintenance Applications, - EN/LZT 108 4108 R1</item> - <item>Erlang 5.0/OTP R7 Tool Applications, EN/LZT 108 4109 R1</item> - </list> - <p><em>About this Book</em> <br></br> -</p> - <p>This book describes all standard libraries in Erlang/OTP. - It contains modules for manipulating lists, strings, and files etc. - </p> - </preface> - </preamble> - <applications> - <include file="../../../../erts/lib/stdlib/doc/src/application"></include> - </applications> -</book> - diff --git a/system/doc/Books/src/tools.xml b/system/doc/Books/src/tools.xml deleted file mode 100644 index 9d7bf45f31..0000000000 --- a/system/doc/Books/src/tools.xml +++ /dev/null @@ -1,139 +0,0 @@ -<?xml version="1.0" encoding="latin1" ?> -<!DOCTYPE book SYSTEM "book.dtd"> - -<book> - <header titlestyle="special"> - <copyright> - <year>2000</year> - <year>2007</year> - <holder>Ericsson AB, All Rights Reserved</holder> - </copyright> - <legalnotice> - The contents of this file are subject to the Erlang Public License, - Version 1.1, (the "License"); you may not use this file except in - compliance with the License. You should have received a copy of the - Erlang Public License along with this software. If not, it can be - retrieved online at http://www.erlang.org/. - - Software distributed under the License is distributed on an "AS IS" - basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See - the License for the specific language governing rights and limitations - under the License. - - The Initial Developer of the Original Code is Ericsson AB. - </legalnotice> - - <title>Erlang 5.1/OTP R8 Tool Applications</title> - <prepared>Bengt Nilsson</prepared> - <docno></docno> - <date>2000-02-09</date> - <rev></rev> - </header> - <insidecover> - <include file="insidecover"></include> - </insidecover> - <pagetext>Erlang/OTP Tools</pagetext> - <preamble> - <contents level="1"></contents> - <preface> - <p><em>Introduction</em> <br></br> -This documentation describes the Open - Telecom Platform (Erlang/OTP), a middle-ware based on the Erlang - programming language, aiming at providing time-saving and flexible - development for robust, adaptable telecom systems.</p> - <p><em>Organization of the Documentation</em> <br></br> - - The documentation is divided into eight parts:</p> - <list type="bulleted"> - <item>Erlang 5.0/OTP R7 System Documentation, EN/LZT 1084095 R1</item> - <item>Erlang 5.0/OTP R7 Run-Time System and Basic Applications, - EN/LZT 108 4106 R1</item> - <item>Erlang 5.0/OTP R7 Standard Library Application, - EN/LZT 108 4107 R1</item> - <item>Erlang 5.0/OTP R7 Database Applications, EN/LZT 108 194 R3</item> - <item>Erlang 5.0/OTP R7 CORBA and IDL Applications, - EN/LZT 151 810 R2</item> - <item>Erlang 5.0/OTP R7 Interface and Communication Applications, - EN/LZT 108 4110 R1</item> - <item>Erlang 5.0/OTP R7 Operation and Maintenance Applications, - EN/LZT 108 4108 R1</item> - <item>Erlang 5.0/OTP R7 Tool Applications, EN/LZT 108 4109 R1</item> - </list> - <p><em>About this Book</em> <br></br> -This book contains User's Guides - and Reference Manuals - for the following applications:</p> - <list type="bulleted"> - <item>Appmon</item> - <item>Debugger</item> - <item>Pman</item> - <item>Toolbar</item> - <item>Tools</item> - <item>TV</item> - </list> - <p>For the following applications, only Reference Manuals are available:</p> - <list type="bulleted"> - <item>Parsetools</item> - <item>Runtime_Tools</item> - </list> - </preface> - </preamble> - <pagetext>Appmon</pagetext> - <parts lift="yes"> - <title>Appmon User's Guide</title> - <include file="../../../../libraries/appmon/doc/src/part"></include> - </parts> - <applications> - <include file="../../../../libraries/appmon/doc/src/application"></include> - </applications> - <pagetext>Debugger</pagetext> - <parts lift="yes"> - <title>Debugger User's Guide</title> - <include file="../../../../tools/debugger/doc/src/part"></include> - </parts> - <applications> - <include file="../../../../tools/debugger/doc/src/application"></include> - </applications> - <pagetext>Pman</pagetext> - <parts lift="yes"> - <title>Pman User's Guide</title> - <include file="../../../../tools/pman/doc/src/part"></include> - </parts> - <applications> - <include file="../../../../tools/pman/doc/src/application"></include> - </applications> - <pagetext>Toolbar</pagetext> - <parts lift="yes"> - <title>Toolbar User's Guide</title> - <include file="../../../../tools/toolbar/doc/src/part"></include> - </parts> - <applications> - <include file="../../../../tools/toolbar/doc/src/application"></include> - </applications> - <pagetext>Tools</pagetext> - <parts lift="no"> - <title>Tools User's Guide</title> - <include file="../../../../tools/tools/doc/src/part"></include> - </parts> - <applications> - <include file="../../../../tools/tools/doc/src/application"></include> - </applications> - <pagetext>TV</pagetext> - <parts lift="yes"> - <title>TV User's Guide</title> - <include file="../../../../tools/tv/doc/src/part"></include> - </parts> - <applications> - <include file="../../../../tools/tv/doc/src/application"></include> - </applications> - <pagetext>Parsetools</pagetext> - <applications> - <include file="../../../../tools/parsetools/doc/src/application"></include> - </applications> - <pagetext>Runtime_Tools</pagetext> - <applications> - <include file="../../../../tools/runtime_tools/doc/src/refman"></include> - </applications> - <pagetext>Erlang/OTP Tools</pagetext> -</book> - diff --git a/system/doc/Books/src/ug.xml b/system/doc/Books/src/ug.xml deleted file mode 100644 index 15b3dc0a31..0000000000 --- a/system/doc/Books/src/ug.xml +++ /dev/null @@ -1,127 +0,0 @@ -<?xml version="1.0" encoding="latin1" ?> -<!DOCTYPE book SYSTEM "book.dtd"> - -<book> - <header titlestyle="special"> - <copyright> - <year>1997</year> - <year>2007</year> - <holder>Ericsson AB, All Rights Reserved</holder> - </copyright> - <legalnotice> - The contents of this file are subject to the Erlang Public License, - Version 1.1, (the "License"); you may not use this file except in - compliance with the License. You should have received a copy of the - Erlang Public License along with this software. If not, it can be - retrieved online at http://www.erlang.org/. - - Software distributed under the License is distributed on an "AS IS" - basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See - the License for the specific language governing rights and limitations - under the License. - - The Initial Developer of the Original Code is Ericsson AB. - </legalnotice> - - <title>Erlang 5.1/OTP R8 System Documentation</title> - <prepared></prepared> - <docno>EN/LZT 151 247 R2</docno> - <date></date> - <rev></rev> - </header> - <insidecover> - <include file="insidecover"></include> - </insidecover> - <pagetext>Erlang/OTP System Documentation</pagetext> - <preamble> - <contents level="2"></contents> - <preface> - <p><em>Introduction</em> <br></br> -This documentation describes the Open - Telecom Platform (Erlang/OTP), a middle-ware based on the Erlang - programming language, aiming at providing time-saving and flexible - development for robust, adaptable telecom systems.</p> - <p><em>Organization of the Documentation</em> <br></br> - - The documentation is divided into eight parts:</p> - <list type="bulleted"> - <item>Erlang 5.0/OTP R7 System Documentation, EN/LZT 1084095 R1</item> - <item>Erlang 5.0/OTP R7 Run-Time System and Basic Applications, - EN/LZT 108 4106 R1</item> - <item>Erlang 5.0/OTP R7 Standard Library Application, EN/LZT 108 4107 - R1</item> - <item>Erlang 5.0/OTP R7 Database Applications, EN/LZT 108 194 R3</item> - <item>Erlang 5.0/OTP R7 CORBA and IDL Applications, - EN/LZT 151 810 R2</item> - <item>Erlang 5.0/OTP R7 Interface and Communication Applications, - EN/LZT 108 4110 R1</item> - <item>Erlang 5.0/OTP R7 Operation and Maintenance Applications, - EN/LZT 108 4108 R1</item> - <item>Erlang 5.0/OTP R7 Tool Applications, EN/LZT 108 4109 R1</item> - </list> - <p><em>About this Book</em> <br></br> - This book is the starting point of the documentation and contains information about the Erlang programming language and runtime system, the OTP design principles, and how to install and configure Erlang/OTP.</p> - <list type="bulleted"> - <item>Chapter 1: Introduction</item> - <item>Chapter 2: "Getting Started with Erlang" gives an introduction to the Erlang runtime system and to tools such as Compiler and Debugger.</item> - <item>Chapter 3: "OTP Design Principles" describes a way to structure Erlang code in terms of applications and supervision trees. The standard behaviors are described and examples illustrate how to apply these behaviors to typical applications.</item> - <item>Chapter 4: "System Principles" describes the strategies - and options, which are available to start an Erlang/OTP system. </item> - <item>Chapter 5: "Operation and Management Principles" describes the model for operation and maintenance of sub-systems.</item> - <item>Chapter 6: "Installation Guide"gives guidelines on how to install Erlang/OTP on UNIX or Windows.</item> - <item>Chapter 7: "Embedded Systems" is a supplement to "Installation Guide", It describes issues that are specific for running Erlang/OTP on an embedded system.</item> - <item>Chapter 8: "Erlang Extensions Since 4.4" lists all extensions to the Erlang programming languages since the latest version of the book <em>Concurrent Programming in ERLANG</em>.</item> - <item>Chapter 9: "Interoperability Tutorial" gives an orientation of the different - interoperability mechanisms, which can be used when integrating an - Erlang program with a program written in an other programming language.</item> - </list> - </preface> - </preamble> - <pagetext>Introduction</pagetext> - <parts lift="yes"> - <title>Introduction</title> - <include file="../../system_architecture_intro/part"></include> - </parts> - <pagetext>Getting Started with Erlang</pagetext> - <parts lift="yes"> - <title>Getting Started with Erlang</title> - <include file="../../getting_started/part"></include> - </parts> - <pagetext>Design Principles</pagetext> - <parts lift="no"> - <title>OTP Design Principles</title> - <include file="../../design_principles/part"></include> - </parts> - <pagetext>System Principles</pagetext> - <parts lift="yes"> - <title>System Principles</title> - <include file="../../system_principles/part"></include> - </parts> - <pagetext>Operation and Management Principles</pagetext> - <parts lift="yes"> - <title>Operation and Management Principles</title> - <include file="../../oam/part"></include> - </parts> - <pagetext>Installation Guide</pagetext> - <parts lift="no"> - <title>Installation Guide</title> - <include file="../../../../system/doc/installation_guide/part"></include> - </parts> - <pagetext>Embedded System</pagetext> - <parts lift="no"> - <title>Embedded System</title> - <include file="../../../../system/doc/embedded/part"></include> - </parts> - <pagetext>Erlang Extensions since 4.4</pagetext> - <parts lift="no"> - <title>Erlang Extensions since 4.4</title> - <include file="../../../../system/doc/extensions/part"></include> - </parts> - <pagetext>Interoperability Tutorial</pagetext> - <parts lift="no"> - <title>Interoperability Tutorial</title> - <include file="../../tutorial/part"></include> - </parts> - <pagetext>Erlang/OTP System Documentation</pagetext> -</book> - diff --git a/system/doc/efficiency_guide/advanced.xml b/system/doc/efficiency_guide/advanced.xml index 0ec3afbd59..2383e3cf3d 100644 --- a/system/doc/efficiency_guide/advanced.xml +++ b/system/doc/efficiency_guide/advanced.xml @@ -4,7 +4,7 @@ <chapter> <header> <copyright> - <year>2001</year><year>2009</year> + <year>2001</year><year>2010</year> <holder>Ericsson AB. All Rights Reserved.</holder> </copyright> <legalnotice> @@ -13,12 +13,12 @@ compliance with the License. You should have received a copy of the Erlang Public License along with this software. If not, it can be retrieved online at http://www.erlang.org/. - + Software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific language governing rights and limitations under the License. - + </legalnotice> <title>Advanced</title> @@ -47,11 +47,13 @@ <cell align="center" valign="middle">Memory size</cell> </row> <row> - <cell align="left" valign="middle">Integer (-16#7FFFFFF < i <16#7FFFFFF)</cell> - <cell align="left" valign="middle">1 word</cell> + <cell align="left" valign="middle">Small integer</cell> + <cell align="left" valign="middle">1 word<br></br> +On 32-bit architectures: -134217729 < i < 134217728 (28 bits)<br></br> +On 64-bit architectures: -576460752303423489 < i < 576460752303423488 (60 bits)</cell> </row> <row> - <cell align="left" valign="middle">Integer (big numbers)</cell> + <cell align="left" valign="middle">Big integer</cell> <cell align="left" valign="middle">3..N words</cell> </row> <row> @@ -72,11 +74,11 @@ On 64-bit architectures: 3 words</cell> </row> <row> <cell align="left" valign="middle">List</cell> - <cell align="left" valign="middle">1 word per element + the size of each element</cell> + <cell align="left" valign="middle">1 word + 1 word per element + the size of each element</cell> </row> <row> <cell align="left" valign="middle">String (is the same as a list of integers)</cell> - <cell align="left" valign="middle">2 words per character</cell> + <cell align="left" valign="middle">1 word + 2 words per character</cell> </row> <row> <cell align="left" valign="middle">Tuple</cell> @@ -154,7 +156,8 @@ On 64-bit architectures: 4 words for a reference from the current local node, an <item>255</item> <tag><em>Atoms </em></tag> <item> <marker id="atoms"></marker> -The maximum number of atoms is 1048576. </item> + By default, the maximum number of atoms is 1048576. + This limit can be raised or lowered using the <c>+t</c> option.</item> <tag><em>Ets-tables</em></tag> <item>The default is 1400, can be changed with the environment variable <c>ERL_MAX_ETS_TABLES</c>.</item> <tag><em>Elements in a tuple</em></tag> @@ -175,7 +178,7 @@ The maximum number of atoms is 1048576. </item> <tag><em>Total amount of data allocated by an Erlang node</em></tag> <item>The Erlang runtime system can use the complete 32 (or 64) bit address space, but the operating system often limits a single process to use less than that.</item> - <tag><em>length of a node name</em></tag> + <tag><em>Length of a node name</em></tag> <item>An Erlang node name has the form host@shortname or host@longname. The node name is used as an atom within the system so the maximum size of 255 holds for the node name too.</item> <tag><em>Open ports</em></tag> diff --git a/system/doc/efficiency_guide/commoncaveats.xml b/system/doc/efficiency_guide/commoncaveats.xml index e18e5aa510..61d13636c0 100644 --- a/system/doc/efficiency_guide/commoncaveats.xml +++ b/system/doc/efficiency_guide/commoncaveats.xml @@ -4,7 +4,7 @@ <chapter> <header> <copyright> - <year>2001</year><year>2009</year> + <year>2001</year><year>2010</year> <holder>Ericsson AB. All Rights Reserved.</holder> </copyright> <legalnotice> @@ -13,12 +13,12 @@ compliance with the License. You should have received a copy of the Erlang Public License along with this software. If not, it can be retrieved online at http://www.erlang.org/. - + Software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific language governing rights and limitations under the License. - + </legalnotice> <title>Common Caveats</title> @@ -69,7 +69,7 @@ <p>Atoms are not garbage-collected. Once an atom is created, it will never be removed. The emulator will terminate if the limit for the number - of atoms (1048576) is reached.</p> + of atoms (1048576 by default) is reached.</p> <p>Therefore, converting arbitrary input strings to atoms could be dangerous in a system that will run continuously. diff --git a/system/doc/efficiency_guide/functions.xml b/system/doc/efficiency_guide/functions.xml index d55b60e39c..fe14a4f000 100644 --- a/system/doc/efficiency_guide/functions.xml +++ b/system/doc/efficiency_guide/functions.xml @@ -4,7 +4,7 @@ <chapter> <header> <copyright> - <year>2001</year><year>2009</year> + <year>2001</year><year>2010</year> <holder>Ericsson AB. All Rights Reserved.</holder> </copyright> <legalnotice> @@ -13,12 +13,12 @@ compliance with the License. You should have received a copy of the Erlang Public License along with this software. If not, it can be retrieved online at http://www.erlang.org/. - + Software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific language governing rights and limitations under the License. - + </legalnotice> <title>Functions</title> @@ -179,7 +179,9 @@ explicit_map_pairs(Map, Xs0, Ys0) -> A "tuple fun", <c>{Module,Function}</c>, is not a fun. The cost for calling a "tuple fun" is similar to that of <c>apply/3</c> or worse. Using "tuple funs" is <em>strongly discouraged</em>, - as they may not be supported in a future release.</p></warning> + as they may not be supported in a future release, + and because there exists a superior alternative since the R10B + release, namely the <c>fun Module:Function/Arity</c> syntax.</p></warning> <p><c>apply/3</c> must look up the code for the function to execute in a hash table. Therefore, it will always be slower than a diff --git a/system/doc/efficiency_guide/myths.xml b/system/doc/efficiency_guide/myths.xml index 76a72368bb..65113c9372 100644 --- a/system/doc/efficiency_guide/myths.xml +++ b/system/doc/efficiency_guide/myths.xml @@ -168,8 +168,8 @@ vanilla_reverse([], Acc) -> <p>Actually, string handling could be slow if done improperly. In Erlang, you'll have to think a little more about how the strings are used and choose an appropriate representation and use - the <seealso marker="stdlib:re">re</seealso> instead of the obsolete - <c>regexp</c> module if you are going to use regualr expressions.</p> + the <seealso marker="stdlib:re">re</seealso> module instead of the obsolete + <c>regexp</c> module if you are going to use regular expressions.</p> </section> <section> diff --git a/system/doc/getting_started/robustness.xml b/system/doc/getting_started/robustness.xml index 227da4c027..c141530fe0 100644 --- a/system/doc/getting_started/robustness.xml +++ b/system/doc/getting_started/robustness.xml @@ -4,7 +4,7 @@ <chapter> <header> <copyright> - <year>2003</year><year>2009</year> + <year>2003</year><year>2010</year> <holder>Ericsson AB. All Rights Reserved.</holder> </copyright> <legalnotice> @@ -13,12 +13,12 @@ compliance with the License. You should have received a copy of the Erlang Public License along with this software. If not, it can be retrieved online at http://www.erlang.org/. - + Software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific language governing rights and limitations under the License. - + </legalnotice> <title>Robustness</title> @@ -146,7 +146,7 @@ after pong_timeout() -></code> a process calls <seealso marker="erts:erlang#link/1">link(Other_Pid)</seealso> it sets up a bidirectional link between itself and the process - called <c>Other_Pid</c>. When a process terminates its sends + called <c>Other_Pid</c>. When a process terminates, it sends something called a <em>signal</em> to all the processes it has links to.</p> <p>The signal carries information about the pid it was sent from and diff --git a/system/doc/installation_guide/Makefile b/system/doc/installation_guide/Makefile index 854025765c..a47d77604d 100644 --- a/system/doc/installation_guide/Makefile +++ b/system/doc/installation_guide/Makefile @@ -31,6 +31,7 @@ APPLICATION=otp-system-documentation # Release directory specification # ---------------------------------------------------- RELSYSDIR = $(RELEASE_PATH)/doc/installation_guide +REDIRECT_HTML_RELSYSDIR = $(RELSYSDIR)/source # ---------------------------------------------------- # Target Specs @@ -54,14 +55,11 @@ XML_FILES = \ $(XML_PART_FILES) # ---------------------------------------------------- -# Install readme files -# ---------------------------------------------------- -SOURCE_INSTALL_READMES = \ - $(ERL_TOP)/INSTALL.html \ - $(ERL_TOP)/INSTALL-CROSS.html \ - $(ERL_TOP)/INSTALL-WIN32.html +GENERATED_XML_FILES = \ + INSTALL.xml \ + INSTALL-CROSS.xml \ + INSTALL-WIN32.xml -SOURCE_RELSYSDIR = $(RELSYSDIR)/source # ---------------------------------------------------- HTML_FILES = \ @@ -71,6 +69,12 @@ HTMLDIR = ../html/installation_guide HTML_UG_FILE = $(HTMLDIR)/users_guide.html +REDIRECT_HTML_DIR = $(HTMLDIR)/source +REDIRECT_HTML_FILES = \ + $(REDIRECT_HTML_DIR)/INSTALL.html \ + $(REDIRECT_HTML_DIR)/INSTALL-CROSS.html \ + $(REDIRECT_HTML_DIR)/INSTALL-WIN32.html + # ---------------------------------------------------- # FLAGS # ---------------------------------------------------- @@ -80,15 +84,32 @@ DVIPS_FLAGS += # ---------------------------------------------------- # Targets # ---------------------------------------------------- -docs: html + +%.xml: $(ERL_TOP)/%.md $(ERL_TOP)/make/emd2exml + $(ERL_TOP)/make/emd2exml $< $@ + +$(REDIRECT_HTML_DIR)/%.html: Makefile + test -d $(REDIRECT_HTML_DIR) || $(INSTALL_DIR) $(REDIRECT_HTML_DIR) + echo "<html><head><meta HTTP-EQUIV=\"REFRESH\"" > $@ + echo " content=\"5; url=../"$(notdir $@)"\">" >> $@ + echo "<title>This page has moved</title></head><body>" >> $@ + echo "<h1>This page has moved</h1>" >> $@ + echo "<p>You will be automatically redirected to its new" >> $@ + echo "location in 5 seconds." >> $@ + echo "This <a href=\"../"$(notdir $@)"\">link</a> will" >> $@ + echo "take you there immediately.</p></body></html>" >> $@ + +docs: $(GENERATED_XML_FILES) html local_docs: PDFDIR=../../pdf +local_docs: $(GENERATED_XML_FILES) -html: $(GIF_FILES) $(HTML_UG_FILE) +html: $(REDIRECT_HTML_FILES) $(GENERATED_XML_FILES) $(GIF_FILES) $(HTML_UG_FILE) -debug opt: +debug opt: clean clean_docs: + rm -f $(GENERATED_XML_FILES) rm -rf $(HTMLDIR) rm -f $(TOP_PDF_FILE) $(TOP_PDF_FILE:%.pdf=%.fo) rm -f errs core *~ @@ -102,8 +123,8 @@ include $(ERL_TOP)/make/otp_release_targets.mk release_docs_spec: docs $(INSTALL_DIR) $(RELSYSDIR) $(INSTALL_DATA) $(GIF_FILES) $(HTMLDIR)/*.html $(RELSYSDIR) - $(INSTALL_DIR) $(SOURCE_RELSYSDIR) - $(INSTALL_DATA) $(SOURCE_INSTALL_READMES) $(SOURCE_RELSYSDIR) + $(INSTALL_DIR) $(REDIRECT_HTML_RELSYSDIR) + $(INSTALL_DATA) $(REDIRECT_HTML_FILES) $(REDIRECT_HTML_RELSYSDIR) release_spec: diff --git a/system/doc/installation_guide/install.xml b/system/doc/installation_guide/install-binary.xml index c1b930a4bd..ac4192586d 100644 --- a/system/doc/installation_guide/install.xml +++ b/system/doc/installation_guide/install-binary.xml @@ -21,7 +21,7 @@ </legalnotice> - <title>Installation</title> + <title>Installing the Binary Release</title> <prepared>Peter Högfeldt</prepared> <responsible>Peter Högfeldt</responsible> <docno></docno> @@ -29,27 +29,10 @@ <checked></checked> <date>1997-05-26</date> <rev>C</rev> - <file>install.xml</file> + <file>install-binary.xml</file> </header> <section> - <title>Source</title> - <p>This document describes installation procedures for - binary releases. Documentation of build and installation - procedures for the source release can be found in the source - tree at the following locations:</p> - <taglist> - <tag>Building and Installing Erlang/OTP</tag> - <item><url href="source/INSTALL.html"><c>$ERL_TOP/INSTALL.md</c></url></item> - <tag>Cross Compiling Erlang/OTP</tag> - <item><url href="source/INSTALL-CROSS.html"><c>$ERL_TOP/INSTALL-CROSS.md</c></url></item> - <tag>How to Build Erlang/OTP on Windows</tag> - <item><url href="source/INSTALL-WIN32.html"><c>$ERL_TOP/INSTALL-WIN32.md</c></url></item> - </taglist> - <p>Where <c>$ERL_TOP</c> is the top directory in the source tree.</p> - </section> - - <section> <title>UNIX</title> <section> @@ -73,7 +56,7 @@ which is <c><![CDATA[<PREFIX>.tar.gz]]></c>, where <c><![CDATA[<PREFIX>]]></c> is a string denoting the particular Erlang/OTP release, e.g. <c>otp_LXA_11930_sunos5_R9B</c>.</p> - <p>Wherever the string <c><![CDATA[<PREFIX>]]></c> is used below, it should + <p>Wherever the string <c><![CDATA[<PREFIX>]]></c> is used below, it should be replaced by the actual name prefix of the compressed tar file.</p> <p>The tape archive file does not have one single directory in which all other files are rooted. Therefore the tape archive file must be @@ -162,4 +145,3 @@ ln -s /usr/local/erlang/otp_r7b/bin/erl /usr/local/bin/erl </pre> </section> </section> </chapter> - diff --git a/system/doc/installation_guide/make.dep b/system/doc/installation_guide/make.dep index 3d1477935d..3878f4ac9d 100644 --- a/system/doc/installation_guide/make.dep +++ b/system/doc/installation_guide/make.dep @@ -9,5 +9,5 @@ # TeX files that the DVI file depend on # ---------------------------------------------------- -book.dvi: book.tex install.tex part.tex verification.tex +book.dvi: book.tex install-binary.tex part.tex verification.tex diff --git a/system/doc/installation_guide/part.xml b/system/doc/installation_guide/part.xml index 3019d2e118..fceacdd8f6 100644 --- a/system/doc/installation_guide/part.xml +++ b/system/doc/installation_guide/part.xml @@ -4,7 +4,7 @@ <part xmlns:xi="http://www.w3.org/2001/XInclude"> <header> <copyright> - <year>2000</year><year>2009</year> + <year>2000</year><year>2010</year> <holder>Ericsson AB. All Rights Reserved.</holder> </copyright> <legalnotice> @@ -13,12 +13,12 @@ compliance with the License. You should have received a copy of the Erlang Public License along with this software. If not, it can be retrieved online at http://www.erlang.org/. - + Software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific language governing rights and limitations under the License. - + </legalnotice> <title>Installation Guide</title> @@ -31,7 +31,10 @@ <description> <p>How to install Erlang/OTP on UNIX or Windows.</p> </description> - <xi:include href="install.xml"/> + <xi:include href="install-binary.xml"/> <xi:include href="verification.xml"/> + <xi:include href="INSTALL.xml"/> + <xi:include href="INSTALL-CROSS.xml"/> + <xi:include href="INSTALL-WIN32.xml"/> </part> diff --git a/system/doc/installation_guide/xmlfiles.mk b/system/doc/installation_guide/xmlfiles.mk index 7e1235b64d..dee67b3c70 100644 --- a/system/doc/installation_guide/xmlfiles.mk +++ b/system/doc/installation_guide/xmlfiles.mk @@ -1,21 +1,24 @@ # # %CopyrightBegin% -# -# Copyright Ericsson AB 2009. All Rights Reserved. -# +# +# Copyright Ericsson AB 2009-2010. All Rights Reserved. +# # The contents of this file are subject to the Erlang Public License, # Version 1.1, (the "License"); you may not use this file except in # compliance with the License. You should have received a copy of the # Erlang Public License along with this software. If not, it can be # retrieved online at http://www.erlang.org/. -# +# # Software distributed under the License is distributed on an "AS IS" # basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See # the License for the specific language governing rights and limitations # under the License. -# +# # %CopyrightEnd% # INST_GUIDE_CHAPTER_FILES = \ - install.xml \ - verification.xml + install-binary.xml \ + verification.xml \ + INSTALL.xml \ + INSTALL-CROSS.xml \ + INSTALL-WIN32.xml diff --git a/system/doc/reference_manual/expressions.xml b/system/doc/reference_manual/expressions.xml index fa7870d96c..714ecccaf6 100644 --- a/system/doc/reference_manual/expressions.xml +++ b/system/doc/reference_manual/expressions.xml @@ -4,7 +4,7 @@ <chapter> <header> <copyright> - <year>2003</year><year>2009</year> + <year>2003</year><year>2010</year> <holder>Ericsson AB. All Rights Reserved.</holder> </copyright> <legalnotice> @@ -13,12 +13,12 @@ compliance with the License. You should have received a copy of the Erlang Public License along with this software. If not, it can be retrieved online at http://www.erlang.org/. - + Software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific language governing rights and limitations under the License. - + </legalnotice> <title>Expressions</title> @@ -217,12 +217,16 @@ lists:keysearch(Name, 1, List)</code> <p>In the second form of function calls, <c>ExprF(Expr1,...,ExprN)</c>, <c>ExprF</c> must be an atom or evaluate to a fun.</p> + <p>If <c>ExprF</c> is an atom the function is said to be called by - using the <em>implicitly qualified function name</em>. If - <c>ExprF/N</c> is the name of a function explicitly or - automatically imported from module <c>M</c>, then the call is - short for <c>M:ExprF(Expr1,...,ExprN)</c>. Otherwise, - <c>ExprF/N</c> must be a locally defined function. Examples:</p> + using the <em>implicitly qualified function name</em>. If the + function <c>ExprF</c> is locally defined, it is called. + Alternatively if <c>ExprF</c> is explicitly imported from module + <c>M</c>, <c>M:ExprF(Expr1,...,ExprN)</c> is called. If + <c>ExprF</c> is neither declared locally nor explicitly + imported, <c>ExprF</c> must be the name of an automatically + imported BIF. Examples:</p> + <code type="none"> handle(Msg, State) spawn(m, init, [])</code> @@ -238,16 +242,85 @@ Fun2([1,2], [3,4]) fun lists:append/2([1,2], [3,4]) => [1,2,3,4]</code> - <p>To avoid possible ambiguities, the fully qualified function - name must be used when calling a function with the same name as - a BIF, and the compiler does not allow defining a function with - the same name as an explicitly imported function.</p> + <p>Note that when calling a local function, there is a difference - between using the implicitly or fully qualified function name, as - the latter always refers to the latest version of the module. See - <seealso marker="code_loading">Compilation and Code Loading</seealso>.</p> + between using the implicitly or fully qualified function name, as + the latter always refers to the latest version of the module. See + <seealso marker="code_loading">Compilation and Code Loading</seealso>.</p> + <p>See also the chapter about <seealso marker="functions#eval">Function Evaluation</seealso>.</p> + + <section> + <title>Local Function Names Clashing With Auto-imported BIFs</title> + <p>If a local function has the same name as an auto-imported BIF, + the semantics is that implicitly qualified function calls are + directed to the locally defined function, not to the BIF. To avoid + confusion, there is a compiler directive available, + <c>-compile({no_auto_import,[F/A]})</c>, that makes a BIF not + being auto-imported. In certain situations, such a compile-directive + is mandatory.</p> + + <warning><p>Before OTP R14A (ERTS version 5.8), an implicitly + qualified function call to a function having the same name as an + auto-imported BIF always resulted in the BIF being called. In + newer versions of the compiler the local function is instead + called. The change is there to avoid that future additions to the + set of auto-imported BIFs does not silently change the behavior + of old code.</p> + + <p>However, to avoid that old (pre R14) code changed it's + behavior when compiled with OTP version R14A or later, the + following restriction applies: If you override the name of a BIF + that was auto-imported in OTP versions prior to R14A (ERTS version + 5.8) and have an implicitly qualified call to that function in + your code, you either need to explicitly remove the auto-import + using a compiler directive, or replace the call with a fully + qualified function call, otherwise you will get a compilation + error. See example below:</p> </warning> + + <code type="none"> +-export([length/1,f/1]). + +-compile({no_auto_import,[length/1]}). % erlang:length/1 no longer autoimported + +length([]) -> + 0; +length([H|T]) -> + 1 + length(T). %% Calls the local funtion length/1 + +f(X) when erlang:length(X) > 3 -> %% Calls erlang:length/1, + %% which is allowed in guards + long.</code> + + <p>The same logic applies to explicitly imported functions from + other modules as to locally defined functions. To both import a + function from another module and have the function declared in the + module at the same time is not allowed.</p> + + <code type="none"> +-export([f/1]). + +-compile({no_auto_import,[length/1]}). % erlang:length/1 no longer autoimported + +-import(mod,[length/1]). + +f(X) when erlang:length(X) > 33 -> %% Calls erlang:lenght/1, + %% which is allowed in guards + + erlang:length(X); %% Explicit call to erlang:length in body + +f(X) -> + length(X). %% mod:length/1 is called</code> + + + <p>For auto-imported BIFs added to Erlang in release R14A and thereafter, + overriding the name with a local function or explicit import is always + allowed. However, if the <c>-compile({no_auto_import,[F/A])</c> + directive is not used, the compiler will issue a warning whenever + the function is called in the module using the implicitly qualified + function name.</p> + </section> </section> <section> @@ -1257,6 +1330,9 @@ end</pre> <cell align="left" valign="middle"><c>is_bitstring/1</c></cell> </row> <row> + <cell align="left" valign="middle"><c>is_boolean/1</c></cell> + </row> + <row> <cell align="left" valign="middle"><c>is_float/1</c></cell> </row> <row> diff --git a/system/doc/reference_manual/records.xml b/system/doc/reference_manual/records.xml index e2fe5fe8de..d01d883ef3 100644 --- a/system/doc/reference_manual/records.xml +++ b/system/doc/reference_manual/records.xml @@ -4,7 +4,7 @@ <chapter> <header> <copyright> - <year>2003</year><year>2009</year> + <year>2003</year><year>2010</year> <holder>Ericsson AB. All Rights Reserved.</holder> </copyright> <legalnotice> @@ -13,12 +13,12 @@ compliance with the License. You should have received a copy of the Erlang Public License along with this software. If not, it can be retrieved online at http://www.erlang.org/. - + Software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific language governing rights and limitations under the License. - + </legalnotice> <title>Records</title> @@ -145,6 +145,29 @@ is_person(_P) -> </section> <section> + <title>Nested records</title> + <p>Beginning with R14 parentheses when accessing or updating nested + records can be omitted. Assuming we have the following record + definitions:</p> + <pre> +-record(nrec0, {name = "nested0"}). +-record(nrec1, {name = "nested1", nrec0=#nrec0{}}). +-record(nrec2, {name = "nested2", nrec1=#nrec1{}}). + +N2 = #nrec2{}, + </pre> + <p>Before R14 you would have needed to use parentheses as following:</p> + <pre> +"nested0" = ((N2#nrec2.nrec1)#nrec1.nrec0)#nrec0.name, +N0n = ((N2#nrec2.nrec1)#nrec1.nrec0)#nrec0{name = "nested0a"}, + </pre> + <p>Since R14 you can also write:</p> + <pre> +"nested0" = N2#nrec2.nrec1#nrec1.nrec0#nrec0.name, +N0n = N2#nrec2.nrec1#nrec1.nrec0#nrec0{name = "nested0a"},</pre> + </section> + + <section> <title>Internal Representation of Records</title> <p>Record expressions are translated to tuple expressions during compilation. A record defined as</p> diff --git a/system/doc/reference_manual/typespec.xml b/system/doc/reference_manual/typespec.xml index a3660713e4..f08639f9a1 100755 --- a/system/doc/reference_manual/typespec.xml +++ b/system/doc/reference_manual/typespec.xml @@ -4,7 +4,7 @@ <chapter> <header> <copyright> - <year>2003</year><year>2009</year> + <year>2003</year><year>2010</year> <holder>Ericsson AB. All Rights Reserved.</holder> </copyright> <legalnotice> @@ -32,29 +32,24 @@ <section> <title>Introduction of Types</title> <p> - Although Erlang is a dynamically typed language this section describes - an extension to the Erlang language for declaring sets of Erlang terms - to form a particular type, effectively forming a specific sub-type of the - set of all Erlang terms. + Erlang is a dynamically typed language. Still, it comes with a + language extension for declaring sets of Erlang terms to form a + particular type, effectively forming a specific sub-type of the set + of all Erlang terms. </p> <p> - Subsequently, these types can be used to specify types of record fields - and the argument and return types of functions. + Subsequently, these types can be used to specify types of record fields + and the argument and return types of functions. </p> <p> - Type information can be used to document function interfaces, - provide more information for bug detection tools such as <c>Dialyzer</c>, - and can be exploited by documentation tools such as <c>Edoc</c> for - generating program documentation of various forms. - It is expected that the type language described in this document will - supersede and replace the purely comment-based <c>@type</c> and + Type information can be used to document function interfaces, + provide more information for bug detection tools such as <c>Dialyzer</c>, + and can be exploited by documentation tools such as <c>Edoc</c> for + generating program documentation of various forms. + It is expected that the type language described in this document will + supersede and replace the purely comment-based <c>@type</c> and <c>@spec</c> declarations used by <c>Edoc</c>. </p> - <warning> - The syntax and semantics described here is still preliminary and might be - slightly changed and extended before it becomes officially supported. - The plan is that this will happen in R14B. - </warning> </section> <section> <marker id="syntax"></marker> @@ -96,7 +91,7 @@ Type :: any() %% The top type, the set of all Erlang terms. | none() %% The bottom type, contains no terms. | pid() | port() - | ref() + | reference() | [] %% nil | Atom | Binary @@ -139,326 +134,334 @@ Tuple :: tuple() %% stands for a tuple of any size TList :: Type | Type, TList ]]></pre> - <p> - Because lists are commonly used, they have shorthand type notations. - The type <c>list(T)</c> has the shorthand <c>[T]</c>. The shorthand <c>[T,...]</c> stands for - the set of non-empty proper lists whose elements are of type <c>T</c>. - The only difference between the two shorthands is that <c>[T]</c> may be an - empty list but <c>[T,...]</c> may not. - </p> - <p> - Notice that the shorthand for <c>list()</c>, i.e. the list of elements of unknown type, - is <c>[_]</c> (or <c>[any()]</c>), not <c>[]</c>. - The notation <c>[]</c> specifies the singleton type for the empty list. - </p> - <p> - For convenience, the following types are also built-in. - They can be thought as predefined aliases for the type unions also shown in - the table. (Some type unions below slightly abuse the syntax of types.) - </p> - <table> - <row> - <cell><b>Built-in type</b></cell><cell><b>Stands for</b></cell> - </row> - <row> - <cell><c>term()</c></cell><cell><c>any()</c></cell> - </row> - <row> - <cell><c>bool()</c></cell><cell><c>'false' | 'true'</c></cell> - </row> - <row> - <cell><c>byte()</c></cell><cell><c>0..255</c></cell> - </row> - <row> - <cell><c>char()</c></cell><cell><c>0..16#10ffff</c></cell> - </row> - <row> - <cell><c>non_neg_integer()</c></cell><cell><c>0..</c></cell> - </row> - <row> - <cell><c>pos_integer()</c></cell><cell><c>1..</c></cell> - </row> - <row> - <cell><c>neg_integer()</c></cell><cell><c>..-1</c></cell> - </row> - <row> - <cell><c>number()</c></cell><cell><c>integer() | float()</c></cell> - </row> - <row> - <cell><c>list()</c></cell><cell><c>[any()]</c></cell> - </row> - <row> - <cell><c>maybe_improper_list()</c></cell><cell><c>maybe_improper_list(any(), any())</c></cell> - </row> - <row> - <cell><c>maybe_improper_list(T)</c></cell><cell><c>maybe_improper_list(T, any())</c></cell> - </row> - <row> - <cell><c>string()</c></cell><cell><c>[char()]</c></cell> - </row> - <row> - <cell><c>nonempty_string()</c></cell><cell><c>[char(),...]</c></cell> - </row> - <row> - <cell><c>iolist()</c></cell><cell><c>maybe_improper_list( -char() | binary() | iolist(), binary() | [])</c></cell> - </row> - <row> - <cell><c>module()</c></cell><cell><c>atom()</c></cell> - </row> - <row> - <cell><c>mfa()</c></cell><cell><c>{atom(),atom(),byte()}</c></cell> - </row> - <row> - <cell><c>node()</c></cell><cell><c>atom()</c></cell> - </row> - <row> - <cell><c>timeout()</c></cell><cell><c>'infinity' | non_neg_integer()</c></cell> - </row> - <row> - <cell><c>no_return()</c></cell><cell><c>none()</c></cell> - </row> - </table> - - <p> - Users are not allowed to define types with the same names as the predefined or - built-in ones. - This is checked by the compiler and its violation results in a compilation - error. - (For bootstrapping purposes, it can also result to just a warning if this - involves a built-in type which has just been introduced.) - </p> - <note> - The following built-in list types also exist, - but they are expected to be rarely used. Hence, they have long names: - </note> - <pre> + <p> + Because lists are commonly used, they have shorthand type notations. + The type <c>list(T)</c> has the shorthand <c>[T]</c>. + The shorthand <c>[T,...]</c> stands for + the set of non-empty proper lists whose elements are of type <c>T</c>. + The only difference between the two shorthands is that <c>[T]</c> may be an + empty list but <c>[T,...]</c> may not. + </p> + <p> + Notice that the shorthand for <c>list()</c>, i.e. the list of + elements of unknown type, is <c>[_]</c> (or <c>[any()]</c>), not <c>[]</c>. + The notation <c>[]</c> specifies the singleton type for the empty list. + </p> + <p> + For convenience, the following types are also built-in. + They can be thought as predefined aliases for the type unions also shown in + the table. (Some type unions below slightly abuse the syntax of types.) + </p> + <table> + <row> + <cell><b>Built-in type</b></cell><cell><b>Stands for</b></cell> + </row> + <row> + <cell><c>term()</c></cell><cell><c>any()</c></cell> + </row> + <row> + <cell><c>boolean()</c></cell><cell><c>'false' | 'true'</c></cell> + </row> + <row> + <cell><c>byte()</c></cell><cell><c>0..255</c></cell> + </row> + <row> + <cell><c>char()</c></cell><cell><c>0..16#10ffff</c></cell> + </row> + <row> + <cell><c>non_neg_integer()</c></cell><cell><c>0..</c></cell> + </row> + <row> + <cell><c>pos_integer()</c></cell><cell><c>1..</c></cell> + </row> + <row> + <cell><c>neg_integer()</c></cell><cell><c>..-1</c></cell> + </row> + <row> + <cell><c>number()</c></cell><cell><c>integer() | float()</c></cell> + </row> + <row> + <cell><c>list()</c></cell><cell><c>[any()]</c></cell> + </row> + <row> + <cell><c>maybe_improper_list()</c></cell><cell><c>maybe_improper_list(any(), any())</c></cell> + </row> + <row> + <cell><c>maybe_improper_list(T)</c></cell><cell><c>maybe_improper_list(T, any())</c></cell> + </row> + <row> + <cell><c>string()</c></cell><cell><c>[char()]</c></cell> + </row> + <row> + <cell><c>nonempty_string()</c></cell><cell><c>[char(),...]</c></cell> + </row> + <row> + <cell><c>iolist()</c></cell><cell><c>maybe_improper_list(char() | binary() | iolist(), binary() | [])</c></cell> + </row> + <row> + <cell><c>module()</c></cell><cell><c>atom()</c></cell> + </row> + <row> + <cell><c>mfa()</c></cell><cell><c>{atom(),atom(),byte()}</c></cell> + </row> + <row> + <cell><c>node()</c></cell><cell><c>atom()</c></cell> + </row> + <row> + <cell><c>timeout()</c></cell><cell><c>'infinity' | non_neg_integer()</c></cell> + </row> + <row> + <cell><c>no_return()</c></cell><cell><c>none()</c></cell> + </row> + </table> + + <p> + Users are not allowed to define types with the same names as the + predefined or built-in ones. This is checked by the compiler and + its violation results in a compilation error. + (For bootstrapping purposes, it can also result to just a warning if this + involves a built-in type which has just been introduced.) + </p> + <note> + The following built-in list types also exist, + but they are expected to be rarely used. Hence, they have long names: + </note> + <pre> nonempty_maybe_improper_list(Type) :: nonempty_maybe_improper_list(Type, any()) -nonempty_maybe_improper_list() :: nonempty_maybe_improper_list(any()) - </pre> - <p> - where the following two types - define the set of Erlang terms one would expect: - </p> - <pre> +nonempty_maybe_improper_list() :: nonempty_maybe_improper_list(any())</pre> + <p> + where the following two types + define the set of Erlang terms one would expect: + </p> + <pre> nonempty_improper_list(Type1, Type2) -nonempty_maybe_improper_list(Type1, Type2) - </pre> - <p> - Also for convenience, we allow for record notation to be used. - Records are just shorthands for the corresponding tuples. - </p> - <pre> +nonempty_maybe_improper_list(Type1, Type2)</pre> + <p> + Also for convenience, we allow for record notation to be used. + Records are just shorthands for the corresponding tuples. + </p> + <pre> Record :: #Erlang_Atom{} - | #Erlang_Atom{Fields} - </pre> + | #Erlang_Atom{Fields}</pre> + <p> + Records have been extended to possibly contain type information. + This is described in the sub-section <seealso marker="#typeinrecords">"Type information in record declarations"</seealso> below. + </p> + </section> + + <section> + <title>Type declarations of user-defined types</title> <p> - Records have been extended to possibly contain type information. - This is described in the sub-section <seealso marker="#typeinrecords">"Type information in record declarations"</seealso> below. - </p> - </section> - - <section> - <title>Type declarations of user-defined types</title> - <p> - As seen, the basic syntax of a type is an atom followed by closed - parentheses. New types are declared using '-type' compiler attributes - as in the following: - </p> - <pre> --type my_type() :: Type. - </pre> - <p> - where the type name is an atom (<c>'my_type'</c> in the above) followed by - parenthesis. Type is a type as defined in the previous section. - A current restriction is that Type can contain only predefined types - or user-defined types which have been previously defined. - This restriction is enforced by the compiler and results in a - compilation error. (A similar restriction currently exists for records). - </p> - <p> - This means that currently general recursive types cannot be defined. - Lifting this restriction is future work. - </p> - <p> - Type declarations can also be parameterized by including type variables - between the parentheses. The syntax of type variables is the same as - Erlang variables (starts with an upper case letter). - Naturally, these variables can - and should - appear on the RHS of the - definition. A concrete example appears below: - </p> - <pre> --type orddict(Key, Val) :: [{Key, Val}]. - </pre> - - </section> - - <marker id="typeinrecords"/> - <section> - <title> - Type information in record declarations - </title> - <p> - The types of record fields can be specified in the declaration of the - record. The syntax for this is: - </p> - <pre> --record(rec, {field1 :: Type1, field2, field3 :: Type3}). - </pre> - <p> - For fields without type annotations, their type defaults to any(). - I.e., the above is a shorthand for: - </p> - <pre> --record(rec, {field1 :: Type1, field2 :: any(), field3 :: Type3}). - </pre> - <p> - In the presence of initial values for fields, - the type must be declared after the initialization as in the following: - </p> - <pre> --record(rec, {field1 = [] :: Type1, field2, field3 = 42 :: Type3}). - </pre> - <p> - Naturally, the initial values for fields should be compatible - with (i.e. a member of) the corresponding types. - This is checked by the compiler and results in a compilation error - if a violation is detected. For fields without initial values, - the singleton type <c>'undefined'</c> is added to all declared types. - In other words, the following two record declarations have identical - effects: - </p> - <pre> + As seen, the basic syntax of a type is an atom followed by closed + parentheses. New types are declared using '-type' and '-opaque' + compiler attributes as in the following: + </p> + <pre> +-type my_struct_type() :: Type. +-opaque my_opaq_type() :: Type.</pre> + <p> + where the type name is an atom (<c>'my_struct_type'</c> in the above) + followed by parentheses. Type is a type as defined in the + previous section. + A current restriction is that Type can contain only predefined types, + or user-defined types which are either module-local (i.e., with a + definition that is present in the code of the module) or are remote + types (i.e., types defined in and exported by other modules; see below). + For module-local types, the restriction that their definition + exists in the module is enforced by the compiler and results in a + compilation error. (A similar restriction currently exists for records.) + </p> + <p> + Type declarations can also be parameterized by including type variables + between the parentheses. The syntax of type variables is the same as + Erlang variables (starts with an upper case letter). + Naturally, these variables can - and should - appear on the RHS of the + definition. A concrete example appears below: + </p> + <pre> +-type orddict(Key, Val) :: [{Key, Val}].</pre> + <p> + A module can export some types in order to declare that other modules + are allowed to refer to them as <em>remote types</em>. + This declaration has the following form: + <pre> +-export_type([T1/A1, ..., Tk/Ak]).</pre> + where the Ti's are atoms (the name of the type) and the Ai's are their + arguments. An example is given below: + <pre> +-export_type([my_struct_type/0, orddict/2]).</pre> + Assuming that these types are exported from module <c>'mod'</c> then + one can refer to them from other modules using remote type expressions + like those below: + <pre> +mod:my_struct_type() +mod:orddict(atom(), term())</pre> + One is not allowed to refer to types which are not declared as exported. + </p> + <p> + Types declared as <c>opaque</c> represent sets of terms whose + structure is not supposed to be visible in any way outside of + their defining module (i.e., only the module defining them is + allowed to depend on their term structure). Consequently, such + types do not make much sense as module local - module local + types are not accessible by other modules anyway - and should + always be exported. + </p> + </section> + + <marker id="typeinrecords"/> + <section> + <title>Type information in record declarations</title> + <p> + The types of record fields can be specified in the declaration of the + record. The syntax for this is: + </p> + <pre> +-record(rec, {field1 :: Type1, field2, field3 :: Type3}).</pre> + <p> + For fields without type annotations, their type defaults to any(). + I.e., the above is a shorthand for: + </p> + <pre> +-record(rec, {field1 :: Type1, field2 :: any(), field3 :: Type3}).</pre> + <p> + In the presence of initial values for fields, + the type must be declared after the initialization as in the following: + </p> + <pre> +-record(rec, {field1 = [] :: Type1, field2, field3 = 42 :: Type3}).</pre> + <p> + Naturally, the initial values for fields should be compatible + with (i.e. a member of) the corresponding types. + This is checked by the compiler and results in a compilation error + if a violation is detected. For fields without initial values, + the singleton type <c>'undefined'</c> is added to all declared types. + In other words, the following two record declarations have identical + effects: + </p> + <pre> -record(rec, {f1 = 42 :: integer(), f2 :: float(), - f3 :: 'a' | 'b'). + f3 :: 'a' | 'b'}). -record(rec, {f1 = 42 :: integer(), f2 :: 'undefined' | float(), - f3 :: 'undefined' | 'a' | 'b'). - </pre> - <p> - For this reason, it is recommended that records contain initializers, - whenever possible. - </p> - <p> - Any record, containing type information or not, once defined, - can be used as a type using the syntax: - </p> - <pre> -#rec{} - </pre> - <p> - In addition, the record fields can be further specified when using - a record type by adding type information about the field in the following - manner: - </p> - <pre> -#rec{some_field :: Type} - </pre> - <p> - Any unspecified fields are assumed to have the type in the original - record declaration. - </p> - </section> + f3 :: 'undefined' | 'a' | 'b'}).</pre> + <p> + For this reason, it is recommended that records contain initializers, + whenever possible. + </p> + <p> + Any record, containing type information or not, once defined, + can be used as a type using the syntax: + </p> + <pre> +#rec{}</pre> + <p> + In addition, the record fields can be further specified when using + a record type by adding type information about the field in + the following manner: + </p> + <pre> +#rec{some_field :: Type}</pre> + <p> + Any unspecified fields are assumed to have the type in the original + record declaration. + </p> + </section> - <section> - <title>Specifications (contracts) for functions</title> - <p> - A contract (or specification) for a function is given using the new - compiler attribute <c>'-spec'</c>. The basic format is as follows: - </p> - <pre> --spec Module:Function(ArgType1, ..., ArgTypeN) -> ReturnType. - </pre> - <p> - The arity of the function has to match the number of arguments, - or else a compilation error occurs. - </p> - <p> - This form can also be used in header files (.hrl) to declare type - information for exported functions. - Then these header files can be included in files that (implicitly or - explicitly) import these functions. - </p> - <p> - For most uses within a given module, the following shorthand is allowed: - </p> - <pre> --spec Function(ArgType1, ..., ArgTypeN) -> ReturnType. - </pre> - <p> - Also, for documentation purposes, argument names can be given: - </p> - <pre> --spec Function(ArgName1 :: Type1, ..., ArgNameN :: TypeN) -> RT. - </pre> - <p> - A function specification can be overloaded. - That is, it can have several types, separated by a semicolon (<c>;</c>): - </p> - <pre> + <section> + <title>Specifications for functions</title> + <p> + A specification (or contract) for a function is given using the new + compiler attribute <c>'-spec'</c>. The general format is as follows: + </p> + <pre> +-spec Module:Function(ArgType1, ..., ArgTypeN) -> ReturnType.</pre> + <p> + The arity of the function has to match the number of arguments, + or else a compilation error occurs. + </p> + <p> + This form can also be used in header files (.hrl) to declare type + information for exported functions. + Then these header files can be included in files that (implicitly or + explicitly) import these functions. + </p> + <p> + For most uses within a given module, the following shorthand suffices: + </p> + <pre> +-spec Function(ArgType1, ..., ArgTypeN) -> ReturnType.</pre> + <p> + Also, for documentation purposes, argument names can be given: + </p> + <pre> +-spec Function(ArgName1 :: Type1, ..., ArgNameN :: TypeN) -> RT.</pre> + <p> + A function specification can be overloaded. + That is, it can have several types, separated by a semicolon (<c>;</c>): + </p> + <pre> -spec foo(T1, T2) -> T3 - ; (T4, T5) -> T6. - </pre> - <p> - A current restriction, which currently results in a warning - (OBS: not an error) by the compiler, is that the domains of the argument - types cannot be overlapping. - For example, the following specification results in a warning: - </p> - <pre> + ; (T4, T5) -> T6.</pre> + <p> + A current restriction, which currently results in a warning + (OBS: not an error) by the compiler, is that the domains of + the argument types cannot be overlapping. + For example, the following specification results in a warning: + </p> + <pre> -spec foo(pos_integer()) -> pos_integer() - ; (integer()) -> integer(). - </pre> - <p> - Type variables can be used in specifications to specify relations for - the input and output arguments of a function. - For example, the following specification defines the type of a - polymorphic identity function: - </p> - <pre> --spec id(X) -> X. - </pre> - <p> - However, note that the above specification does not restrict the input - and output type in any way. - We can constrain these types by guard-like subtype constraints: - </p> - <pre> --spec id(X) -> X when is_subtype(X, tuple()). - </pre> - <p> - and provide bounded quantification. Currently, - the <c>is_subtype/2</c> guard is the only guard which can - be used in a <c>'-spec'</c> attribute. - </p> - <p> - The scope of an <c>is_subtype/2</c> constraint is the - <c>(...) -> RetType</c> - specification after which it appears. To avoid confusion, - we suggest that different variables are used in different constituents of - an overloaded contract as in the example below: - </p> - <pre> --spec foo({X, integer()}) -> X when is_subtype(X, atom()) - ; ([Y]) -> Y when is_subtype(Y, number()). - </pre> - <p> - Some functions in Erlang are not meant to return; - either because they define servers or because they are used to - throw exceptions as the function below: - </p> - <pre> -my_error(Err) -> erlang:throw({error, Err}). - </pre> - <p> - For such functions we recommend the use of the special no_return() - type for their "return", via a contract of the form: - </p> - <pre> --spec my_error(term()) -> no_return(). - </pre> - </section> + ; (integer()) -> integer().</pre> + <p> + Type variables can be used in specifications to specify relations for + the input and output arguments of a function. + For example, the following specification defines the type of a + polymorphic identity function: + </p> + <pre> +-spec id(X) -> X.</pre> + <p> + However, note that the above specification does not restrict the input + and output type in any way. + We can constrain these types by guard-like subtype constraints: + </p> + <pre> +-spec id(X) -> X when is_subtype(X, tuple()).</pre> + <p> + or equivalently by the more succinct and more modern form of the above: + </p> + <pre> +-spec id(X) -> X when X :: tuple().</pre> + <p> + and provide bounded quantification. Currently, the <c>::</c> constraint + (the <c>is_subtype/2</c> guard) is the only guard constraint which can + be used in the <c>'when'</c> part of a <c>'-spec'</c> attribute. + </p> + <p> + The scope of an <c>::</c> constraint is the + <c>(...) -> RetType</c> + specification after which it appears. To avoid confusion, + we suggest that different variables are used in different + constituents of an overloaded contract as in the example below: + </p> + <pre> +-spec foo({X, integer()}) -> X when X :: atom() + ; ([Y]) -> Y when Y :: number().</pre> + <p> + Some functions in Erlang are not meant to return; + either because they define servers or because they are used to + throw exceptions as the function below: + </p> + <pre> +my_error(Err) -> erlang:throw({error, Err}).</pre> + <p> + For such functions we recommend the use of the special no_return() + type for their "return", via a contract of the form: + </p> + <pre> +-spec my_error(term()) -> no_return().</pre> + </section> </chapter> diff --git a/system/doc/top/Makefile b/system/doc/top/Makefile index 154deb006b..aac90fcaa4 100644 --- a/system/doc/top/Makefile +++ b/system/doc/top/Makefile @@ -111,6 +111,10 @@ GLOSSARY = $(HTMLDIR)/glossary.html GLOSSARY_SRC = $(ERL_TOP)/system/internal_tools/doctools/src/glossary.erl GLOSSARY_SCRIPT = $(EBIN)/glossary.$(EMULATOR) +TEMPLATES = \ + templates/index.html.src \ + templates/applications.html.src + #-------------------------------------------------------------------------- $(INDEX_SCRIPT): $(INDEX_SRC) @@ -119,8 +123,14 @@ $(INDEX_SCRIPT): $(INDEX_SRC) # We don't list toc_*.html as targets because we don't know $(HTMLDIR)/index.html + $(HTMLDIR)/applications.html: $(INDEX_SCRIPT) echo "Generating index $@" - $(ERL) -noshell -pa $(EBIN) -s erl_html_tools top_index $(ERL_TOP) \ - $(HTMLDIR) $(SYSTEM_VSN) -s erlang halt +# Check if we are building the index from source or an installed release + if test "$$RELEASE_ROOT" = "" ; then \ + $(ERL) -noshell -pa $(EBIN) -s erl_html_tools top_index src $(ERL_TOP) \ + $(HTMLDIR) $(SYSTEM_VSN) -s erlang halt ;\ + else \ + $(ERL) -noshell -pa $(EBIN) -s erl_html_tools top_index rel $(RELEASE_ROOT) \ + $(HTMLDIR) $(SYSTEM_VSN) -s erlang halt ;\ + fi #-------------------------------------------------------------------------- @@ -139,8 +149,15 @@ $(MAN_INDEX_SCRIPT): $(MAN_INDEX_SRC) $(ERLC) -o$(EBIN) +warn_unused_vars $< $(MAN_INDEX): $(MAN_INDEX_SCRIPT) - $(ERL) -noshell -pa $(EBIN) -s otp_man_index gen $(ERL_TOP) $@ \ - -s erlang halt +# Check if we are building the index from source or an installed release + if test "$$RELEASE_ROOT" = "" ; then \ + $(ERL) -noshell -pa $(EBIN) -s otp_man_index gen src $(ERL_TOP) $@ \ + -s erlang halt ;\ + else \ + $(ERL) -noshell -pa $(EBIN) -s otp_man_index gen rel $(RELEASE_ROOT) $@ \ + -s erlang halt ;\ + fi + #-------------------------------------------------------------------------- @@ -226,7 +243,11 @@ release_docs_spec: docs $(INSTALL_DIR) $(RELSYSDIR)/js $(INSTALL_DATA) \ $(JAVASCRIPT) $(RELSYSDIR)/js - $(INSTALL_DATA) $(INDEX_FILES) $(MAN_INDEX) $(TOP_HTML_FILES) $(RELSYSDIR) + $(INSTALL_DATA) $(INDEX_FILES) $(MAN_INDEX) $(TOP_HTML_FILES) $(RELSYSDIR) + $(INSTALL_DIR) $(RELSYSDIR)/docbuild + $(INSTALL_DATA) $(INDEX_SCRIPT) $(MAN_INDEX_SCRIPT) $(JAVASCRIPT_BUILD_SCRIPT) \ + $(INDEX_SRC) $(MAN_INDEX_SRC) $(JAVASCRIPT_BUILD_SCRIPT_SRC) \ + $(TEMPLATES) $(RELSYSDIR)/docbuild release_spec: diff --git a/system/doc/top/highlights.xml b/system/doc/top/highlights.xml index a30742aed6..251bb1a47d 100644 --- a/system/doc/top/highlights.xml +++ b/system/doc/top/highlights.xml @@ -4,7 +4,7 @@ <chapter> <header> <copyright> - <year>2006</year><year>2009</year> + <year>2006</year><year>2010</year> <holder>Ericsson AB. All Rights Reserved.</holder> </copyright> <legalnotice> @@ -13,12 +13,12 @@ compliance with the License. You should have received a copy of the Erlang Public License along with this software. If not, it can be retrieved online at http://www.erlang.org/. - + Software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific language governing rights and limitations under the License. - + </legalnotice> <title>Highlights</title> @@ -28,133 +28,53 @@ <rev>A</rev> <file>highlights.xml</file> </header> - <p>This document lists some highlights of Erlang 5.7/OTP R13A - (unpatched), compared to the previous version Erlang 5.6/OTP R12B, - with focus on things not already released as R12B patches.</p> - <p>Note: This document was compiled at the time when R13A was released - and does not list any features introduced in R13 patches.</p> + <p>This document lists some highlights of Erlang 5.8/OTP R14A + (unpatched), compared to the previous version Erlang 5.7.1/OTP R13B, + with focus on things not already released as R13B patches.</p> + <p>Note: This document was compiled at the time when R14A was released + and does not list any features introduced in R14 patches.</p> <section> <title>Erlang Language and Run-time System</title> <section> - <title>Multi-core and SMP performance improvements</title> - <p> - There SMP performance is significantly improved and will - allow most applications to scale much better on systems with many - cores or processors. Listed below are some of the most important improvements: - </p> - <list type="bulleted"> - <item> - <p> - The runtime system with SMP support now uses <em>multiple, - scheduler specific run queues</em>, instead of one globally shared - run queue. - </p> - <p> - The lock protecting the shared run queue was heavily - contended, and the shared run queue also caused Erlang - processes to randomly migrate between schedulers with - negative cache effects as a result. - </p> - <p> - With the current scheduler specific run queue solution, lock - contention due to run queue protection has been reduced, and - Erlang processes are only migrated when needed to balance the - load between the schedulers. The reduced amount of migration - also reduce lock contention on locks protecting the scheduler - specific instances of the erts internal memory allocators. - </p> - <p> - The scheduler specific run queues are also a necessity for a - lot of future planned NUMA (Non-Uniform Memory Access) - specific optimizations. - </p> - </item> - <item> - <p> - Message passing has been further optimized for parallell execution. - This makes parallell sending to one common receiver much more efficient. - </p> - </item> - <item> - <p> - Scheduler threads can now be bound to logical processors on newer - Linux ans Solaris systems. - </p> - </item> - </list> - </section> - <section> - <title>Unicode support</title> - <p> - Support for Unicode is implemented as described in EEP10. - Formatting and reading of unicode data both from terminals - and files is supported by the <c>io</c> and <c>io_lib</c> modules. - Files - can be opened in modes with automatic translation to and from - different unicode formats. The module 'unicode' contains - functions for conversion between external and internal - unicode formats and the re module has support for unicode - data. There is also language syntax for specifying string and - character data beyond the ISO-latin-1 range. - </p> - </section> + <title>New NIF features</title> + <list type="bulleted"> + <item><p>Send messages from a NIF, or from thread created by NIF, to + any local process (enif_send)</p></item> - <section> - <title>New BIF's</title> - <p> - The BIFs <c>atom_to_binary/2</c>, <c>binary_to_atom/2</c> and - <c>binary_to_existing_atom/2</c> have been added. - </p> - </section> - - <section> - <title>Independent Erlang clusters on the same host</title> - <p> - Nodes belonging to different independent clusters can now - co-exist on the same host with the help of a new - environment variable setting <c>ERL_EPMD_PORT</c>. - The environment variable is used by Erl_interface and J_interface - as well. - </p> - </section> - </section> + <item><p>Store terms between NIF calls (enif_alloc_env, + enif_make_copy)</p></item> - <section> - <title>New Applications</title> + <item><p>Create binary terms with user defined memory management + (enif_make_resource_binary)</p></item> + <item><p>Some incompatible changes made to the API. For more + information see the warning text in erl_nif(3).</p></item> + </list> + </section> <section> - <title>Reltool</title> - - <p> - Reltool is a release management tool. - It analyses a given Erlang/OTP installation and determines - various dependencies between applications. - The graphical frontend depicts the dependencies and enables - interactive customization of a target system. - The backend provides a batch interface for generation of - customized target systems. - The application is still somewhat limited and should be regarded - as experimental in this release. The intention is that this - application will be a valuable tool for making both traditional - Erlang target systems as well as standalone components in Erlang. - </p> + <title>Receive optimizations</title> + <p>Receive statements that can only read out a newly created + reference are now specially optimized so that it will execute + in constant time regardless of the number of messages in the + receive queue for the process. That optimization will benefit + calls to gen_server:call(). (See gen:do_call/4 for an example + of a receive statement that will be optimized.)</p> </section> - <section> - <title>WxErlang</title> - <p> - wxErlang is an Erlang binding to the WxWidgets GUI library which - provides support for cross platform GUI applications. - wxErlang is still in beta status and the intention is that it shall - replace GS in a later stage. The Erlang debugger is also shipped in - a wxErlang version. - </p> + <title>Improved eprof</title> + <p>eprof has been reimplemented with support in the Erlang + virtual machine and is now both faster (i.e. slows down the + code being measured less) and scales much better. In + measurements we saw speed-ups compared to the old eprof + ranging from 6 times (for sequential code that only uses one + scheduler/core) up to 84 times (for parallel code that uses 8 + cores).</p> + + <p>Note: The API for the eprof has been cleaned up and extended. + See the documentation.</p> </section> - - </section> - <section> <title>New features in Existing Applications</title> @@ -162,77 +82,29 @@ <title>Common_test</title> <p> - A support client module for SSH and SFTP, <c>ct_ssh</c>, has - been introduced. - </p> - <p> - Test case groups have been introduced. With this feature - it's possible to execute groups (possibly nested) - of test cases. + It is now possible for the user to provide specific callback + modules that handle test configuration data, so that data on + arbitray form can be accessed (e.g. by reading files or by + communicating with a configuration server process). Two + default callback modules have been introduced in Common Test: + ct_config_plain and ct_config_xml. The former is used to + handle the traditional Common Test configuration files (with + terms on key-value tuple form) and the latter to handle + configuration data on XML representation. </p> <p> - A group definition contains a name tag, a list of - properties and a list of test cases (including possible - nested group definitions). The properties make it possible - to execute test cases in parallel, in sequence and in - shuffled order. It is also possible to repeat test cases - according to different criteria. + The run_test script has been replaced by a program (with the + same name) which can be executed without explicit + installation. The start flags are the same as for the legacy + start script. </p> </section> - - <section> - <title>Dialyzer</title> - <p> - The analysis now accepts <em>opaque type declarations</em> and - detects - violations of opaqueness of terms of such types. Starting - with R13, many Erlang/OTP standard libraries (array, dict, - digraph, ets, gb_sets, gb_trees, queue, and sets) contain - opaque type declarations of their main data types. Dialyzer - will spit out warnings in code that explicitly depends on the - structure of these terms. - </p> - <p> - Added support for handling UTF segments in bitstreams and for - detecting obvious type errors in these segments. Warning: - This code is not terribly tested though since there are very - few Erlang programs which use Unicode-based binaries - not - surprising since this is a new language feature of R13. - </p> - <p> - Strengthened the discrepancy identification when testing for - equality and matching between terms of different types. This - detects more bugs in code. - </p> - <p> - See the Dialyzer documentation and release notes for even more - enhancements. - </p> - </section> - - <section> - <title>SSL</title> - <p> - The "new_ssl" implementation is significantly improved and should be - near product status now. - The new SSL is implemented in pure Erlang except for - the crypto routines that are implemented in the crypto driver which - is an interface to libcrypto from OpenSSL. - </p> - </section> - - <section> <title>STDLIB</title> - - <p>The Erlang scanner has been augmented as to return white-space, - comments and exact location of tokens. - This means that the scanner can easily be used in tools such as editors, - pretty printers, syntax highlighters etc. - where it is important to be able recreate the original source document. + <p> + The module binary from EEP31 (and EEP9) is implemented. </p> </section> - </section> </chapter> diff --git a/system/doc/top/incompatible.xml b/system/doc/top/incompatible.xml index ce9522725b..e09fa7272f 100644 --- a/system/doc/top/incompatible.xml +++ b/system/doc/top/incompatible.xml @@ -4,7 +4,7 @@ <chapter> <header> <copyright> - <year>2006</year><year>2009</year> + <year>2006</year><year>2010</year> <holder>Ericsson AB. All Rights Reserved.</holder> </copyright> <legalnotice> @@ -13,12 +13,12 @@ compliance with the License. You should have received a copy of the Erlang Public License along with this software. If not, it can be retrieved online at http://www.erlang.org/. - + Software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific language governing rights and limitations under the License. - + </legalnotice> <title>Potential Incompatibilities</title> @@ -29,353 +29,241 @@ <file>incompatible.xml</file> </header> <p>This document contains a list of potential incompatibilities - between Erlang 5.7/OTP R12A and Erl 5.6.5/OTP R12B-5, + between Erlang 5.8/OTP R14A and Erl 5.7.5/OTP R13B04, and is an extract from the release notes for the respective applications.</p> <section> - <title>compiler</title> + <title>Tools</title> <list type="bulleted"> <item> <p> - The undocumented, unsupported, and deprecated guard BIF - <c>is_constant/1</c> has been removed.</p> - <p> - *** INCOMPATIBILITY with R12B ***</p> - <p> - Own Id: OTP-7673</p> - </item> - <item> - <p>The short-circuit operators <c>andalso</c> and - <c>orelse</c> no longer guarantees that their second - argument is either <c>true</c> or <c>false</c>. As a - consequence, <c>andalso</c>/<c>orelse</c> are now - tail-recursive.</p> - <p> - *** POTENTIAL INCOMPATIBILITY ***</p> + Xref has been updated to use the re module instead of the + deprecated regexp module.</p> + <p>*** INCOMPATIBILITY with R12B ***</p> <p> - Own Id: OTP-7748</p> + Own Id: OTP-8472</p> </item> <item> - <p>The compiler will refuse to a compile file where the - module name in the file differs from the output file - name.</p> - <p>When compiling using <c>erlc</c>, the current working - directory will no be included in the code path (unless - explicitly added using "-pa .").</p> - <p> - *** POTENTIAL INCOMPATIBILITY ***</p> - <p> - Own Id: OTP-7793</p> - </item> - <item> - <p>If a module contains an exported function with the - same name as an auto-imported BIF (such as - <c>length/1</c>), any calls to the BIF must have an - explicit <c>erlang:</c> prefix, or there will be a - compilation error (such calls would only generate a - warning in previous releases).</p> - <p>(The reason for the change is to avoid breaking code - in a future major release, R14 or R15, in which we plan - to make calls without a module prefix always call the - local function in the same module even if there is an - auto-imported BIF with the same name.)</p> + <p>eprof has been reimplemented with support in the Erlang + virtual machine and is now both faster (i.e. slows down the + code being measured less) and scales much better. In + measurements we saw speed-ups compared to the old eprof + ranging from 6 times (for sequential code that only uses one + scheduler/core) up to 84 times (for parallel code that uses 8 + cores).</p> + + <p>Note: The API for the eprof has been cleaned up and extended. + See the documentation.</p> <p> *** POTENTIAL INCOMPATIBILITY ***</p> <p> - Own Id: OTP-7873</p> + Own Id: OTP-8706</p> </item> </list> </section> <section> - <title>Erts</title> + <title>Odbc</title> <list type="bulleted"> <item> - <p>Support for Unicode is implemented as described in - EEP10. Formatting and reading of unicode data both from - terminals and files is supported by the io and io_lib - modules. Files can be opened in modes with automatic - translation to and from different unicode formats. The - module 'unicode' contains functions for conversion - between external and internal unicode formats and the re - module has support for unicode data. There is also - language syntax for specifying string and character data - beyond the ISO-latin-1 range.</p> - <p>The interactive shell will support input and output of - unicode characters when the terminal and operating system - supports it.</p> - <p>Please see the EEP and the io/io_lib manual pages as - well as the stdlib users guide for details.</p> - <p><em>I/O-protocol incompatibilities:</em></p> - <p>The io_protocol between io_Server and client is - updated to handle protocol data in unicode formats. The - updated protocol is now documented. The specification - resides in the stdlib <em>users manual</em>, which is a - new part of the manual.</p> - <p><em>io module incompatibilities:</em></p> - <p>The io:put_chars, io:get_chars and io:get_line all - handle and return unicode data. In the case where - binaries can be provided (as to io:put_chars), they shall - be encoded in UTF-8. When binaries are returned (as by - io:get_line/get_chars when the io_server is set in - <em>binary mode</em>) the returned data is also - <em>always</em> encoded as UTF-8. The file module however - still returns byte-oriented data, why file:read can be - used instead of io:get_chars to read binary data in - ISO-latin-1.</p> - <p><em>io_lib module incompatibilities:</em></p> - <p>io_lib:format can, given new format directives (i.e - "~ts" and "~tc"), return lists containing integers larger - than 255. </p> - <p> - *** POTENTIAL INCOMPATIBILITY ***</p> - <p> - Own Id: OTP-7648 Aux Id: OTP-7580 OTP-7514 OTP-7494 - OTP-7443 OTP-7181 EEP10 EEP11 </p> - </item> - <item> - <p> - The undocumented, unsupported, and deprecated guard BIF - <c>is_constant/1</c> has been removed.</p> - <p> - *** INCOMPATIBILITY with R12B ***</p> - <p> - Own Id: OTP-7673</p> - </item> - <item> - <p>The short-circuit operators <c>andalso</c> and - <c>orelse</c> no longer guarantees that their second - argument is either <c>true</c> or <c>false</c>. As a - consequence, <c>andalso</c>/<c>orelse</c> are now - tail-recursive.</p> + <p> + Now supports SQL_TYPE_TIMESTAMP on the format {{YY, MM, DD}, + {HH, MM, SS}}. Thanks to Juhani Ränkimies. + </p> <p> *** POTENTIAL INCOMPATIBILITY ***</p> <p> - Own Id: OTP-7748</p> + Own Id: OTP-8511</p> </item> - <item> - <p>The compiler will refuse to a compile file where the - module name in the file differs from the output file - name.</p> - <p>When compiling using <c>erlc</c>, the current working - directory will no be included in the code path (unless - explicitly added using "-pa .").</p> + </list> + </section> + + <section> + <title>Ssh</title> + <list type="bulleted"> + <item> <p> - *** POTENTIAL INCOMPATIBILITY ***</p> + The configuration parameter ip_v6_disabled is now available, + which makes it possible for the user to alter the IP version + SSH shall use.</p> <p> - Own Id: OTP-7793</p> - </item> - <item> - <p>The deprecated functions <c>erlang:fault/1</c>, - <c>erlang:fault/2</c>, and <c>file:rawopen/2</c> have - been removed.</p> + *** POTENTIAL INCOMPATIBILITY ***</p> <p> - *** POTENTIAL INCOMPATIBILITY ***</p> + Own Id: OTP-8535</p> + </item> + <item> <p> - Own Id: OTP-7812</p> - </item> - <item> - <p>The escape sequences <c>\x</c> and <c>\{</c> have been - assigned new interpretations (they used to return the - ASCII code for <c>x</c> and <c>{</c> respectively). One - or more octal characters inside curly brackets after a - leading backslash is from now on an alternative to the - existing syntax <c>\NNN</c>, but can also be used for - codes greater than 255. In a similar fashion, one or more - hexadecimal characters can be put inside curly brackets - after a leading <c>\x</c>. Furthermore, the escape - sequences <c>\xH</c> and <c>\xHH</c>, where N is a - hexadecimal character, can be used for codes less than - 256.</p> - <p>NOTE: These new escape sequences are still considered - experimental and may be changed in the R13B release.</p> + Removed deprecated modules (ssh_ssh, ssh_sshd and ssh_cm) and + functions (ssh_sftp:connect and ssh_sftp:stop).</p> <p> - *** POTENTIAL INCOMPATIBILITY ***</p> + *** POTENTIAL INCOMPATIBILITY ***</p> <p> - Own Id: OTP-7855</p> - </item> - </list> - </section> - - <section> - <title>Inets</title> - <list type="bulleted"> + Own Id: OTP-8596</p> + </item> <item> <p> - [httpc] - The inets http client will now use persistent - connections without pipelining as default and if a - pipeline timeout is set it will pipeline the requests on - the persistent connections.</p> + Aligned error message with used version (SSH_FX_FAILURE vs + SSH_FX_NOT_A_DIRECTORY, the latter introduced in version 6).</p> <p> *** POTENTIAL INCOMPATIBILITY ***</p> <p> - Own Id: OTP-7463</p> - </item> + Own Id: OTP-8644</p> + </item> </list> </section> <section> - <title>Jinterface</title> + <title>ERTS</title> <list> <item> - <p> - A number of fixes and improvements from the ErlIDE group; - Vlad Dumitrescu and Jakob Cederlund: JDK 1.5 is now a - minimal requirement for building Jinterface. New method: - OtpEpmd.lookupNames. OtpErlangList is now iterable. - Non-proper lists are now allowed - you have to test if a - list is proper or not. Non-proper lists can also be - created. New methods: isProper, getHead, getTail and - getNthTail. The get tail methods creates a sublist object - that re-uses the original list. OtpErlangPid is now - Comparable. Empty atoms can now be constructed, a missing - feature pointed out by Sebastien Boisgerault on - erlang-questions.</p> + <p>Some incompatible changes made to the NIF API. For more + information see the warning text in erl_nif(3).</p> <p> *** POTENTIAL INCOMPATIBILITY ***</p> <p> - Own Id: OTP-7832</p> + Own Id: OTP-8555</p> </item> </list> </section> <section> - <title>Kernel</title> + <title>STDLIB</title> <list type="bulleted"> <item> - <p>The deprecated functions <c>erlang:fault/1</c>, - <c>erlang:fault/2</c>, and <c>file:rawopen/2</c> have - been removed.</p> + <p>When defining macros the closing right parenthesis before the + dot is now mandatory.</p> <p> *** POTENTIAL INCOMPATIBILITY ***</p> <p> - Own Id: OTP-7812</p> + Own Id: OTP-8562</p> </item> </list> </section> <section> - <title>SSH</title> + <title>Compiler and STDLIB</title> <list type="bulleted"> <item> <p> - Ssh timeouts will now behave as expected i.e. defaults to - infinity. Only the user of the ssh application can know of - a reasonable timeout value for their application.</p> + Local and imported functions now override the auto-imported + BIFs when the names clash. The pre R14 behaviour was that + auto-imported BIFs would override local functions. To avoid + that old programs change behaviour, the following will + generate an error:</p> + + <list type="bulleted"> + <item>Doing a call without explicit module name to a local function + having a name clashing with the name of an auto-imported BIF + that was present (and auto-imported) before OTP R14A</item> + + <item>Explicitly importing a function having a name clashing with + the name of an autoimported BIF that was present (and + autoimported) before OTP R14A</item> + + <item>Using any form of the old compiler directive nowarn_bif_clash</item> + </list> + + <p>If the BIF was added or auto-imported in OTP R14A or later, + overriding it with an import or a local function will only + result in a warning.</p> + + <p>To resolve clashes, you can either use the explicit module + name erlang to call the BIF, or you can remove the + auto-import of that specific BIF by using the new compiler + directive -compile({no_auto_import,[F/A]})., which makes all + calls to the local or imported function without explicit + module name pass without warnings or errors.</p> + + <p>The change makes it possible to add auto-imported BIFs + without breaking or silently changing old code in the future. + However some current code ingeniously utilizing the old + behaviour or the nowarn_bif_clash compiler directive, might + need changing to be accepted by the compiler.</p> <p> *** POTENTIAL INCOMPATIBILITY ***</p> <p> - Own Id: OTP-7807</p> + Own Id: OTP-8579</p> </item> <item> <p> - Added the message {ssh_channel_up, ChannelId, - ConnectionManager} that shall be handled by the channel - callback handle_msg/2. This makes the function - handle_msg/2 a mandatory function for ssh channels - implementations which it was not in ssh-1.1.</p> + The recently added BIFs erlang:min/2, erlang:max/2 and + erlang:port_command/3 are now auto-imported (as they were + originally intended to be). Due to the recent compiler change + (OTP-8579), the only impact on old code defining it's own + min/2, max/2 or port_command/3 functions will be a warning, + the local functions will still be used. The warning can be + removed by using + -compile({no_auto_import,[min/2,max/2,port_command/3]}). in + the source file.</p> <p> *** POTENTIAL INCOMPATIBILITY ***</p> <p> - Own Id: OTP-7828</p> + Own Id: OTP-8669</p> </item> - </list> - </section> - - <section> - <title>STDLIB</title> - <list type="bulleted"> <item> - <p>The functions <c>lists:seq/1,2</c> return the empty - list in a few cases when they used to generate an - exception, for example <c>lists:seq(1, 0)</c>. See - lists(3) for details. (Thanks to Richard O'Keefe.)</p> <p> - *** POTENTIAL INCOMPATIBILITY ***</p> + Now, binary_to_term/2 is auto-imported. This will cause a + compile warning if and only if a module has got a local + function with that name.</p> <p> - Own Id: OTP-7230</p> - </item> - <item> - <p>Support for Unicode is implemented as described in - EEP10. Formatting and reading of unicode data both from - terminals and files is supported by the io and io_lib - modules. Files can be opened in modes with automatic - translation to and from different unicode formats. The - module 'unicode' contains functions for conversion - between external and internal unicode formats and the re - module has support for unicode data. There is also - language syntax for specifying string and character data - beyond the ISO-latin-1 range.</p> - <p>The interactive shell will support input and output of - unicode characters when the terminal and operating system - supports it.</p> - <p>Please see the EEP and the io/io_lib manual pages as - well as the stdlib users guide for details.</p> - <p><em>I/O-protocol incompatibilities:</em></p> - <p>The io_protocol between io_Server and client is - updated to handle protocol data in unicode formats. The - updated protocol is now documented. The specification - resides in the stdlib <em>users manual</em>, which is a - new part of the manual.</p> - <p><em>io module incompatibilities:</em></p> - <p>The io:put_chars, io:get_chars and io:get_line all - handle and return unicode data. In the case where - binaries can be provided (as to io:put_chars), they shall - be encoded in UTF-8. When binaries are returned (as by - io:get_line/get_chars when the io_server is set in - <em>binary mode</em>) the returned data is also - <em>always</em> encoded as UTF-8. The file module however - still returns byte-oriented data, why file:read can be - used instead of io:get_chars to read binary data in - ISO-latin-1.</p> - <p><em>io_lib module incompatibilities:</em></p> - <p>io_lib:format can, given new format directives (i.e - "~ts" and "~tc"), return lists containing integers larger - than 255. </p> - <p> - *** POTENTIAL INCOMPATIBILITY ***</p> - <p> - Own Id: OTP-7648 Aux Id: OTP-7580 OTP-7514 OTP-7494 - OTP-7443 OTP-7181 EEP10 EEP11 </p> - </item> - <item> - <p> - <c>filelib:fold_files/5</c> now uses the <c>re</c> module - instead of the <c>regexp</c> module for regular - expression matching. In practice, this change will not be - a problem for most regular expressions used for - <c>filelib:fold_files/5</c>. (The major difference in - regular expression is that parenthesis and curly brackets - is treated as literal characters by <c>regexp</c> but as - special characters by <c>re</c>; fortunately, those - characters are rarely used in filenames.)</p> - <p> - *** POTENTIAL INCOMPATIBILITY ***</p> + *** POTENTIAL INCOMPATIBILITY ***</p> <p> - Own Id: OTP-7819</p> + Own Id: OTP-8671</p> </item> + </list> + </section> + + <section> + <title>Erl_interface</title> + <list type="bulleted"> <item> - <p> - <c>digraph:new(Type)</c> will now cause a <c>badarg</c> - exception if <c>Type</c> is not a valid type. Similarly, - <c>digraph_utils:subgraph/2,3</c> will now cause a - <c>badarg</c> if the arguments are invalid. (Those - functions used to return error tuples if something was - wrong.)</p> + <p>Compact IEEE 754 double encoding in external binary format + for ei</p> + + <p>Implement the compact IEEE 754 double encoding in external + binary format for ei. Encoding for ei now always produces the + NEW_FLOAT_EXT format. Decoding and term printing handle both + the old ERL_FLOAT_EXT encoding and the new NEW_FLOAT_EXT + encoding.</p> + + <p>Legacy erl_interface code also handles the new encoding, but + still produces the ERL_FLOAT_EXT encoding by default.</p> + + <p>Also enable the DFLAG_NEW_FLOATS distribution flag.</p> + + <p>ei_get_type() will return ERL_FLOAT_EXT regardless if the + external format is encoded with ERL_FLOAT_EXT or + NEW_FLOAT_EXT for doubles.</p> + + <p>Reduce the number of copies of the code for encoding and + decoding doubles throughout ei and erl_interface by instead + calling the ei encoding and decoding functions wherever + possible.</p> + + <p>Restore commented-out float tests in ei_decode_SUITE and + ei_encode_SUITE in lib/erl_interface/test. Modify them to + make them match the style of other tests in the same suites.</p> + + <p>These changes are based on an ei float patch from Serge + Aleynikov originally submitted against R12B-2 in July 2008 + and reworked by Steve Vinoski May 2010.</p> <p> *** POTENTIAL INCOMPATIBILITY ***</p> <p> - Own Id: OTP-7824</p> + Own Id: OTP-8684</p> </item> + </list> + </section> + <section> + <title>Debugger and STDLIB</title> + <list type="bulleted"> <item> - <p>The argument passed to <c>random:uniform/1</c> must - now be an integer (as stated in the documentation). In - previous releases, a floating point number was also - allowed.</p> + <p> The predefined builtin type tid() has been removed. Instead, + ets:tid() should be used.</p> <p> *** POTENTIAL INCOMPATIBILITY ***</p> <p> - Own Id: OTP-7827</p> + Own Id: OTP-8687</p> </item> </list> </section> diff --git a/system/doc/top/src/erl_html_tools.erl b/system/doc/top/src/erl_html_tools.erl index c920245f94..599268804e 100644 --- a/system/doc/top/src/erl_html_tools.erl +++ b/system/doc/top/src/erl_html_tools.erl @@ -26,7 +26,7 @@ %%----------------------------------------------------------------- -module(erl_html_tools). --export([top_index/0,top_index/1,top_index/3,top_index_silent/3]). +-export([top_index/0,top_index/1,top_index/4,top_index_silent/3]). -include_lib("kernel/include/file.hrl"). @@ -40,7 +40,8 @@ group_order() -> {test, "Test"}, {doc, "Documentation"}, {orb, "Object Request Broker & IDL"}, - {misc, "Miscellaneous"} + {misc, "Miscellaneous"}, + {eric, "Ericsson Internal"} ]. top_index() -> @@ -49,19 +50,22 @@ top_index() -> io:format("Variable ERL_TOP is required\n",[]); Value -> {_,RelName} = init:script_id(), - top_index(Value, filename:join(Value, "doc"), RelName) + top_index(src, Value, filename:join(Value, "doc"), RelName) end. -top_index([RootDir, DestDir, OtpRel]) +top_index([src, RootDir, DestDir, OtpRel]) when is_atom(RootDir), is_atom(DestDir), is_atom(OtpRel) -> - top_index(atom_to_list(RootDir), atom_to_list(DestDir), atom_to_list(OtpRel)); -top_index(RootDir) when is_atom(RootDir) -> + top_index(src, atom_to_list(RootDir), atom_to_list(DestDir), atom_to_list(OtpRel)); +top_index([rel, RootDir, DestDir, OtpRel]) + when is_atom(RootDir), is_atom(DestDir), is_atom(OtpRel) -> + top_index(rel, atom_to_list(RootDir), atom_to_list(DestDir), atom_to_list(OtpRel)); +top_index(RootDir) when is_atom(RootDir) -> {_,RelName} = init:script_id(), - top_index(RootDir, filename:join(RootDir, "doc"), RelName). + top_index(rel, RootDir, filename:join(RootDir, "doc"), RelName). -top_index(RootDir, DestDir, OtpRel) -> +top_index(Source, RootDir, DestDir, OtpRel) -> report("****\nRootDir: ~p", [RootDir]), report("****\nDestDir: ~p", [DestDir]), report("****\nOtpRel: ~p", [OtpRel]), @@ -72,13 +76,13 @@ top_index(RootDir, DestDir, OtpRel) -> report("****\nTemplates: ~p", [Templates]), Bases = [{"../lib/", filename:join(RootDir,"lib")}, {"../", RootDir}], - Groups = find_information(Bases), + Groups = find_information(Source, Bases), report("****\nGroups: ~p", [Groups]), process_templates(Templates, DestDir, Groups). top_index_silent(RootDir, DestDir, OtpRel) -> put(silent,true), - Result = top_index(RootDir, DestDir, OtpRel), + Result = top_index(rel, RootDir, DestDir, OtpRel), erase(silent), Result. @@ -159,8 +163,8 @@ find_templates([], AllSearchPaths) -> % This function read all application names and if present all "info" files. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -find_information(Bases) -> - Paths = find_application_paths(Bases), +find_information(Source, Bases) -> + Paths = find_application_paths(Source, Bases), % report("****\nPaths: ~p", [Paths]), Apps = find_application_infos(Paths), % report("****\nApps: ~p", [Apps]), @@ -176,35 +180,47 @@ find_information(Bases) -> % % We know URL ends in a slash. -find_application_paths([]) -> +find_application_paths(_, []) -> []; -find_application_paths([{URL, Dir} | Paths]) -> +find_application_paths(Source, [{URL, Dir} | Paths]) -> + + AppDirs = get_app_dirs(Dir), + AppPaths = get_app_paths(Source, AppDirs, URL), + AppPaths ++ find_application_paths(Source, Paths). + + +get_app_paths(src, AppDirs, URL) -> Sub1 = "doc/html/index.html", %% Sub2 = "doc/index.html", + lists:map( + fun({App, AppPath}) -> + VsnFile = filename:join(AppPath, "vsn.mk"), + VsnStr = + case file:read_file(VsnFile) of + {ok, Bin} -> + case re:run(Bin, ".*VSN\s*=\s*([0-9\.]+).*",[{capture,[1],list}]) of + {match, [V]} -> + V; + nomatch -> + exit(io_lib:format("No VSN variable found in ~s\n", + [VsnFile])) + end; + {error, Reason} -> + exit(io_lib:format("~p : ~s\n", [Reason, VsnFile])) + end, + AppURL = URL ++ App ++ "-" ++ VsnStr, + {App, VsnStr, AppPath, AppURL ++ "/" ++ Sub1} + end, AppDirs); +get_app_paths(rel, AppDirs, URL) -> + Sub1 = "doc/html/index.html", +%% Sub2 = "doc/index.html", + lists:map( + fun({App, AppPath}) -> + [AppName, VsnStr] = string:tokens(App, "-"), + AppURL = URL ++ App, + {AppName, VsnStr, AppPath, AppURL ++ "/" ++ Sub1} + end, AppDirs). - AppDirs = get_app_dirs(Dir), - - AppPaths = - lists:map( - fun({App, AppPath}) -> - VsnFile = filename:join(AppPath, "vsn.mk"), - VsnStr = - case file:read_file(VsnFile) of - {ok, Bin} -> - case re:run(Bin, ".*VSN\s*=\s*([0-9\.]+).*",[{capture,[1],list}]) of - {match, [V]} -> - V; - nomatch -> - exit(io_lib:format("No VSN variable found in ~s\n", - [VsnFile])) - end; - {error, Reason} -> - exit(io_lib:format("~p : ~s\n", [Reason, VsnFile])) - end, - AppURL = URL ++ App ++ "-" ++ VsnStr, - {App, VsnStr, AppPath, AppURL ++ "/" ++ Sub1} - end, AppDirs), - AppPaths ++ find_application_paths(Paths). get_app_dirs(Dir) -> {ok, Files} = file:list_dir(Dir), @@ -212,7 +228,7 @@ get_app_dirs(Dir) -> lists:map(fun(File) -> {File, filename:join([Dir, File])} end, Files), lists:zf(fun is_app_with_doc/1, AFiles). -is_app_with_doc({"." ++ ADir, _APath}) -> +is_app_with_doc({"." ++ _ADir, _APath}) -> false; is_app_with_doc({ADir, APath}) -> case file:read_file_info(filename:join([APath, "info"])) of diff --git a/system/doc/top/src/otp_man_index.erl b/system/doc/top/src/otp_man_index.erl index 0fdc531b37..4ad975c53d 100644 --- a/system/doc/top/src/otp_man_index.erl +++ b/system/doc/top/src/otp_man_index.erl @@ -27,14 +27,20 @@ -module(otp_man_index). --export([gen/1]). +-export([gen/1, gen/2]). -include_lib("kernel/include/file.hrl"). -gen([RootDir, OutFile]) when is_atom(RootDir), is_atom(OutFile)-> +gen([Source, RootDir, OutFile]) when is_atom(RootDir), is_atom(OutFile)-> + gen(Source, RootDir, OutFile). + +gen(RootDir, OutFile) -> + gen(rel, RootDir, OutFile). + +gen(Source, RootDir, OutFile) -> Bases = [{"../lib/", filename:join(RootDir, "lib")}, {"../", RootDir}], - Apps = find_application_paths(Bases), + Apps = find_application_paths(Source, Bases), RefPages = find_ref_files(Apps), gen_html(RefPages, atom_to_list(OutFile)). @@ -81,43 +87,52 @@ find_ref_files([{App, Vsn, AppPath, RelPath} |Apps], Acc) -> find_ref_files(Apps, Refs2 ++ Acc) end. -find_application_paths([]) -> +find_application_paths(_, []) -> []; -find_application_paths([{URL, Dir} | Paths]) -> - Sub1 = "doc/html", +find_application_paths(Source, [{URL, Dir} | Paths]) -> AppDirs = get_app_dirs(Dir), - - AppPaths = - lists:map( - fun({App, AppPath}) -> - VsnFile = filename:join(AppPath, "vsn.mk"), - VsnStr = - case file:read_file(VsnFile) of - {ok, Bin} -> - case re:run(Bin, ".*VSN\s*=\s*([0-9\.]+).*",[{capture,[1],list}]) of - {match, [V]} -> - V; - nomatch -> - exit(io_lib:format("No VSN variable found in ~s\n", - [VsnFile])) - end; - {error, Reason} -> - exit(io_lib:format("~p : ~s\n", [Reason, VsnFile])) - end, - AppURL = URL ++ App ++ "-" ++ VsnStr, - {App, VsnStr, AppPath ++ "/" ++ Sub1, AppURL ++ "/" ++ Sub1} - end, AppDirs), - AppPaths ++ find_application_paths(Paths). - + AppPaths = get_app_paths(Source, AppDirs, URL), + AppPaths ++ find_application_paths(Source, Paths). +get_app_paths(src, AppDirs, URL) -> + Sub1 = "doc/html", + lists:map( + fun({App, AppPath}) -> + VsnFile = filename:join(AppPath, "vsn.mk"), + VsnStr = + case file:read_file(VsnFile) of + {ok, Bin} -> + case re:run(Bin, ".*VSN\s*=\s*([0-9\.]+).*",[{capture,[1],list}]) of + {match, [V]} -> + V; + nomatch -> + exit(io_lib:format("No VSN variable found in ~s\n", + [VsnFile])) + end; + {error, Reason} -> + exit(io_lib:format("~p : ~s\n", [Reason, VsnFile])) + end, + AppURL = URL ++ App ++ "-" ++ VsnStr, + {App, VsnStr, AppPath ++ "/" ++ Sub1, AppURL ++ "/" ++ Sub1} + end, AppDirs); +get_app_paths(rel, AppDirs, URL) -> + Sub1 = "doc/html", + lists:map( + fun({App, AppPath}) -> + [AppName, VsnStr] = string:tokens(App, "-"), + AppURL = URL ++ App, + {AppName, VsnStr, AppPath ++ "/" ++ Sub1, AppURL ++ "/" ++ Sub1} + end, AppDirs). + + get_app_dirs(Dir) -> {ok, Files} = file:list_dir(Dir), AFiles = lists:map(fun(File) -> {File, filename:join([Dir, File])} end, Files), lists:zf(fun is_app_with_doc/1, AFiles). -is_app_with_doc({"." ++ ADir, _APath}) -> +is_app_with_doc({"." ++ _ADir, _APath}) -> false; is_app_with_doc({ADir, APath}) -> case file:read_file_info(filename:join([APath, "info"])) of diff --git a/system/doc/top/templates/index.html.src b/system/doc/top/templates/index.html.src index 88d425ac1d..655f532a5d 100644 --- a/system/doc/top/templates/index.html.src +++ b/system/doc/top/templates/index.html.src @@ -39,10 +39,6 @@ under the License. <small><a href="applications.html">Applications</a><br> <a href="man_index.html">Modules</a></small> <p/> -<small><a href="highlights.html">Release highlights</a><br/> -<a href="incompatible.html">Potential incompatibilities</a><br/> -</small> -<br> <a href="javascript:openAllFlips()">Expand All</a><br> <a href="javascript:closeAllFlips()">Contract All</a> <p/> diff --git a/system/doc/tutorial/c_port.xmlsrc b/system/doc/tutorial/c_port.xmlsrc index 7e6034807b..b4caa07578 100644 --- a/system/doc/tutorial/c_port.xmlsrc +++ b/system/doc/tutorial/c_port.xmlsrc @@ -70,7 +70,7 @@ loop(Port) -> {call, Caller, Msg} -> Port ! {self(), {command, encode(Msg)}}, receive -\011{Port, {data, Data}} -> + {Port, {data, Data}} -> Caller ! {complex, decode(Data)} end, loop(Port) diff --git a/system/doc/tutorial/complex6.erl b/system/doc/tutorial/complex6.erl new file mode 100644 index 0000000000..a5f51886c8 --- /dev/null +++ b/system/doc/tutorial/complex6.erl @@ -0,0 +1,11 @@ +-module(complex6). +-export([foo/1, bar/1]). +-on_load(init/0). + +init() -> + ok = erlang:load_nif("./complex6_nif", 0). + +foo(_X) -> + exit(nif_library_not_loaded). +bar(_Y) -> + exit(nif_library_not_loaded). diff --git a/system/doc/tutorial/complex6_nif.c b/system/doc/tutorial/complex6_nif.c new file mode 100644 index 0000000000..b656ed43ce --- /dev/null +++ b/system/doc/tutorial/complex6_nif.c @@ -0,0 +1,32 @@ +#include "erl_nif.h" + +extern int foo(int x); +extern int bar(int y); + +static ERL_NIF_TERM foo_nif(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[]) +{ + int x, ret; + if (!enif_get_int(env, argv[0], &x)) { + return enif_make_badarg(env); + } + ret = foo(x); + return enif_make_int(env, ret); +} + +static ERL_NIF_TERM bar_nif(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[]) +{ + int y, ret; + if (!enif_get_int(env, argv[0], &y)) { + return enif_make_badarg(env); + } + ret = bar(y); + return enif_make_int(env, ret); +} + +static ErlNifFunc nif_funcs[] = { + {"foo", 1, foo_nif}, + {"bar", 1, bar_nif} +}; + +ERL_NIF_INIT(complex6, nif_funcs, NULL, NULL, NULL, NULL) + diff --git a/system/doc/tutorial/nif.xmlsrc b/system/doc/tutorial/nif.xmlsrc new file mode 100644 index 0000000000..f9197c69dd --- /dev/null +++ b/system/doc/tutorial/nif.xmlsrc @@ -0,0 +1,136 @@ +<?xml version="1.0" encoding="latin1" ?> +<!DOCTYPE chapter SYSTEM "chapter.dtd"> + +<chapter> + <header> + <copyright> + <year>2000</year><year>2009</year> + <holder>Ericsson AB. All Rights Reserved.</holder> + </copyright> + <legalnotice> + The contents of this file are subject to the Erlang Public License, + Version 1.1, (the "License"); you may not use this file except in + compliance with the License. You should have received a copy of the + Erlang Public License along with this software. If not, it can be + retrieved online at http://www.erlang.org/. + + Software distributed under the License is distributed on an "AS IS" + basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See + the License for the specific language governing rights and limitations + under the License. + + </legalnotice> + + <title>NIFs</title> + <prepared></prepared> + <docno></docno> + <date></date> + <rev></rev> + <file>nif.xml</file> + </header> + <p>This is an example of how to solve the <seealso marker="example">example problem</seealso> + by using NIFs. NIFs where introduced in R13B03 as an experimental + feature. It is a simpler and more efficient way of calling C-code + than using port drivers. NIFs are most suitable for synchronous functions like + <c>foo</c> and <c>bar</c> in the example, that does some + relatively short calculations without side effects and return the result.</p> + <section> + <title>NIFs</title> + <p>A NIF (Native Implemented Function) is a function that is + implemented in C instead of Erlang. NIFs appear as any other functions to + the callers. They belong to a module and are called like any other Erlang + functions. The NIFs of a module are compiled and linked into a dynamic + loadable shared library (SO in Unix, DLL in Windows). The NIF library must + be loaded in runtime by the Erlang code of the module.</p> + <p>Since a NIF library is dynamically linked into the emulator + process, this is the fastest way of calling C-code from Erlang (alongside + port drivers). Calling NIFs requires no context switches. But it is also + the least safe, because a crash in a NIF will bring the emulator down + too.</p> + </section> + + <section> + <title>Erlang Program</title> + <p>Even if all functions of a module will be NIFs, you still need an Erlang + module for two reasons. First, the NIF library must be explicitly loaded + by Erlang code in the same module. Second, all NIFs of a module must have + an Erlang implementation as well. Normally these are minimal stub + implementations that throw an exception. But it can also be used as + fallback implementations for functions that do not have native + implemenations on some architectures.</p> + <p>NIF libraries are loaded by calling <c>erlang:load_nif/2</c>, with the + name of the shared library as argument. The second argument can be any + term that will be passed on to the library and used for + initialization.</p> + + <codeinclude file="complex6.erl" tag="" type="none"></codeinclude> + + <p>We use the directive <c>on_load</c> to get function <c>init</c> to be + automatically called when the module is loaded. If <c>init</c> + returns anything other than <c>ok</c>, such when the loading of + the NIF library fails in this example, the module will be + unloaded and calls to functions within it will fail.</p> + <p>Loading the NIF library will override the stub implementations + and cause calls to <c>foo</c> and <c>bar</c> to be dispatched to + the NIF implementations instead.</p> + </section> + <section> + <title>NIF library code</title> + <p>The NIFs of the module are compiled and linked into a + shared library. Each NIF is implemented as a normal C function. The macro + <c>ERL_NIF_INIT</c> together with an array of structures defines the names, + arity and function pointers of all the NIFs in the module. The header + file <c>erl_nif.h</c> must be included. Since the library is a shared + module, not a program, no main function should be present.</p> + <p>The function arguments passed to a NIF appears in an array <c>argv</c>, + with <c>argc</c> as the length of the array and thus the arity of the + function. The Nth argument of the function can be accessed as + <c>argv[N-1]</c>. NIFs also takes an environment argument that + serves as an opaque handle that is needed to be passed on to + most API functions. The environment contains information about + the calling Erlang process.</p> + + <codeinclude file="complex6_nif.c" tag="" type="none"></codeinclude> + + <p>The first argument to <c>ERL_NIF_INIT</c> must be the name of the + Erlang module as a C-identifier. It will be stringified by the + macro. The second argument is the array of <c>ErlNifFunc</c> + structures containing name, arity and function pointer of + each NIF. The other arguments are pointers to callback functions + that can be used to initialize the library. We do not use them + is this simple example so we set them all to <c>NULL</c>.</p> + <p>Function arguments and return values are represented as values + of type <c>ERL_NIF_TERM</c>. We use functions like <c>enif_get_int</c> + and <c>enif_make_int</c> to convert between Erlang term and C-type. + If the function argument <c>argv[0]</c> is not an integer then + <c>enif_get_int</c> will return false, in which case we return + by throwing a <c>badarg</c>-exception with <c>enif_make_badarg</c>.</p> + </section> + + <section> + <title>Running the Example</title> + <p>1. Compile the C code.</p> + <pre> +unix> <input>gcc -o complex6_nif.so -fpic -shared complex.c complex6_nif.c</input> +windows> <input>cl -LD -MD -Fe complex6_nif.dll complex.c complex6_nif.c</input></pre> + <p>2. Start Erlang and compile the Erlang code.</p> + <pre> +> <input>erl</input> +Erlang R13B04 (erts-5.7.5) [64-bit] [smp:4:4] [rq:4] [async-threads:0] [kernel-poll:false] + +Eshell V5.7.5 (abort with ^G) +1> <input>c(complex6).</input> +{ok,complex6}</pre> + <p>3. Run the example.</p> +<pre> +3> <input>complex6:foo(3).</input> +4 +4> <input>complex6:bar(5).</input> +10 +5> <input>complex6:foo("not an integer").</input> +** exception error: bad argument + in function complex6:foo/1 + called as comlpex6:foo("not an integer") +</pre> +</section> +</chapter> diff --git a/system/doc/tutorial/part.xml b/system/doc/tutorial/part.xml index 1a8a873242..ff73b668c0 100644 --- a/system/doc/tutorial/part.xml +++ b/system/doc/tutorial/part.xml @@ -4,7 +4,7 @@ <part xmlns:xi="http://www.w3.org/2001/XInclude"> <header> <copyright> - <year>2000</year><year>2009</year> + <year>2000</year><year>2010</year> <holder>Ericsson AB. All Rights Reserved.</holder> </copyright> <legalnotice> @@ -13,19 +13,19 @@ compliance with the License. You should have received a copy of the Erlang Public License along with this software. If not, it can be retrieved online at http://www.erlang.org/. - + Software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific language governing rights and limitations under the License. - + </legalnotice> <title>Interoperability Tutorial</title> <prepared>Gunilla Hugosson</prepared> <docno></docno> <date>2000-01-18</date> - <rev>R7B</rev> + <rev>R14A</rev> </header> <xi:include href="introduction.xml"/> <xi:include href="overview.xml"/> @@ -34,5 +34,6 @@ <xi:include href="erl_interface.xml"/> <xi:include href="c_portdriver.xml"/> <xi:include href="cnode.xml"/> + <xi:include href="nif.xml"/> </part> diff --git a/system/doc/tutorial/xmlfiles.mk b/system/doc/tutorial/xmlfiles.mk index 794ef49774..95562bec60 100644 --- a/system/doc/tutorial/xmlfiles.mk +++ b/system/doc/tutorial/xmlfiles.mk @@ -1,19 +1,19 @@ # # %CopyrightBegin% -# -# Copyright Ericsson AB 2009. All Rights Reserved. -# +# +# Copyright Ericsson AB 2009-2010. All Rights Reserved. +# # The contents of this file are subject to the Erlang Public License, # Version 1.1, (the "License"); you may not use this file except in # compliance with the License. You should have received a copy of the # Erlang Public License along with this software. If not, it can be # retrieved online at http://www.erlang.org/. -# +# # Software distributed under the License is distributed on an "AS IS" # basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See # the License for the specific language governing rights and limitations # under the License. -# +# # %CopyrightEnd% # TUTORIAL_CHAPTER_FILES = \ @@ -23,7 +23,8 @@ TUTORIAL_CHAPTER_FILES = \ erl_interface.xml \ c_portdriver.xml \ example.xml\ - overview.xml + overview.xml\ + nif.xml # appendix.xml # distribution.xml (to be part of tutorial later) |