SL_AppInitA System Command

NAME
SL_AppInitA -- init the application.
SL_AppInit -- varargs stub for SL_AppInitA().

SYNOPSIS
apphandle = SL_AppInitA(argc, argv, taglist);
D0D1 A0 A1

APPHANLDE SL_AppInitA(int, SLCHAR **, struct TagItem *);

apphandle = SL_AppInit(argc, argv, firsttag, ...);

APPHANDLE SL_AppInit(int, SLCHAR **, Tag, ...);

FUNCTION
Allocates an APPHANDLE, inits it, and returns it to the
application.

Does what is necessary to initialize the application under
the OS it is running on.

Processes the startup arguments for the application and builds the
arglist. (out of argnodes - see SL_CreateArgNode)

Builds the list of files to open at startup time.

INPUTS
argc - this is the argument count from main().
argv - this is the argument array from main().
tags - pointer to a tag list specifiying how to init the application.

TAGS
APPATTR_Name (SLCHAR *) - The name of the application.

APPATTR_Version (SLCHAR *) - The version string of the application.

APPATTR_Copyright (SLCHAR *) - A copyright notice.

APPATTR_Date (SLCHAR *) - The date of the application.

APPATTR_Author (SLCHAR *) - The name of the applications author.

APPATTR_RsrcArray (void *) - Internal resource array pointer.

APPATTR_Args (SLCHAR **) - pointer to table of arguments this app suports.

APPATTR_ArgDefs (SLCHAR **) - pointer to table of default values for arguments.

APPATTR_MacroTable (struct MacroTable *) - pointer to macro table.

APPATTR_UserData (SLTAGDATA) - Application specific data.

APPATTR_Callback (void (*)(struct AppMsg *)) - the address of the
function to call to process AppMsg's.
see Callback-Application for more information.

RESULTS
apphandle - an APPHANDLE if the init was successful. If the application could not be inited, then a NULL is returned.
WARNING
SL_AppInit cannot be called unless SL_SystemInit was successful.

All applications main() routine should look similar to this:

int main(int argc, SLCHAR **argv)
{
APPHANDLE apphandle;

if(SL_SystemInit())
{
if( (apphandle=SL_AppInitA(argc, argv, tags)) )
{
//app specific startup code here

SL_AppEventHandler(apphandle);

//app specific cleanup code here

SL_AppCleanup(apphandle);
}
SL_SystemCleanup();
}
}

SEE ALSO
SL_AppCleanup, SL_GetAppAttr, SL_SetAppAttrA.

 

SL_AppInitA  Command Definition  url:SL_AppInitA
  created:2008-03-01 23:36:11   last updated:2008-03-02 15:34:16
  Copyright © 1985-2024 GrasshopperLLC. All Rights Reserved.

User Contributed Comments For SL_AppInitA
There are no user contributed comments for this page.