•  Back 
  •  XCONTROL Callback Functions 
  •  Index 
  •  Tree View 
  •  Cross references 
  •  %About 
  •  Show info about hypertext 
  •  View a new file 
Topic       : The ATARI Compendium
Author      : Scott Sanders / JAY Software
Version     : 1.25 (20/6/2003)
Subject     : Documentation
Nodes       : 1117
Index Size  : 32614
HCP-Version : 6
Compiled on : Atari
@charset    : UTF-8
@lang       : en
@default    : 
@help       : %About
@options    : +g -i -t4 +y +z
@width      : 100
View Ref-FileXCONTROL Callback Functions
cpx_init()                                                         XCONTROL

Syntax

CPXINFO (*cpx_init)( xcpb )
XCPB *xcpb;

Function      cpx_init() is called upon bootup and every subsequent time
              the CPX is opened by the user.

Parameters    xcpb points to an XControl Parameter Block structure as
              described in the beginning of this chapter.

Binding       The cpx_init() function is called by JSR'ing to the first
              location in the CPX's TEXT segment. 'C' programmers should
              assemble and link the following code as the first object
              file in the link to ensure that the correct function is
              properly called:
              ; Startup stub for CPX's without save area

                           .xref _cpx_init

                           .text

              cpxstart:    jmp  _cpx_init

                           .end

              If the CPX has default data which is to be saved back into
              the CPX with the CPX_Save() function, the following stub
              should be used (substitute the '.dc.w 1' statement with the
              appropriate amount of space required to store your data):

              ; Startup stub for CPX's with save area

                           .xref  _cpx_init
                           .globl _save_vars

                           .text

              cpxstart:    jmp    _cpx_init

                           .data

              _save_vars:  dc.w  1

                           .end

Return Value  The cpx_init() function returns a pointer to its CPXINFO
              structure to allow the Control Panel to access its other
              routines. If it is a 'Set-Only' CPX, it should return NULL.

Comments      A CPX can distunguish when a CPX is booting by checking the
              xcpb->booting structure member. It is recommended that the
              CPX to create a copy of xcpb each time cpx_init() is called
              for the other callback functions to utilize.

Group         XCONTROL Callback Functions