RegisterSection
RegisterSection Add the section record to the list of registered sections
#include <Editions.h> Edition Manager
OSErr RegisterSection( sectionDocument, sectionH,
aliasWasUpdated );
const FSSpec *sectionDocument ; contains the volume reference number,
directory ID, and filename
SectionHandle sectionH ; a handle to a section record
Boolean * aliasWasUpdated ; TRUE= alias is out of date or was updated
returns Error Code; 0=no error
The RegisterSection function adds the section record to the
Edition Manager's list of registered sections and tries to allocate a control
block. After calling the RegisterSection function, the controlBlock field of
the section record is either NIL or a valid control block.
sectionDocument >]t
contains the volume reference number, directory ID, and filename
of the document that contains a section.
sectionH Iis a handle to the section record for a given section.
aliasWasUpdated returns TRUE if the alias for the edition container subscribed to was
out of date and was updated. This may occur if the edition file was
moved to a new location or was renamed.
Returns: an operating system Error Code.
noErr (0) No error
userCanceledErr (-128) User chose Cancel from a mount server dialog box
editionMgrInitErr (-450) Manager not initialized
badSectionErr (-451) Not a valid section type
multiplePublisherWrn (-460) Already is a publisher
containerNotFoundWrn (-461) Alias was not resolved
notThePublisherWrn (-463) Not the publisher

Notes: For a subscriber, the control block is NIL if the RegisterSection
function could not locate the edition container being subscribed to. The
RegisterSection function then returns either the containerNotFoundWrn
or the userCanceledErr result code. For a publisher, if the
RegisterSection function could not locate its corresponding edition
container, the Edition Manager creates an edition container in the last
place the edition was located and creates a control block for it. If the
RegisterSection function could not locate a publisher's corresponding
edition container or its volume, the control block is NIL. You should never
reregister a section that is already registered.
Note that you can compare control blocks for individual sections. If two
sections contain the same control block value, these sections publish or
subscribe to the same edition (unless the control block is NIL). The
Edition Manager keeps track of how many sections are referencing a
control block to know when it can be de allocated. The control block
maintains a count of how many sections are referencing it. Each time you use
the UnRegisterSection function, the control block subtracts one from the
number of sections. When the number of sections reaches 0, the control
block is de allocated.
Your application receives the multiplePublisherWrn result code if there
is another registered publisher to the same edition. Your application
receives the notThePublisherWrn result code if another publisher (to the
same edition) was the last section to write to the edition. The
multiplePublisherWrn result code takes priority over the
notThePublisherWrn result code.