Warning: main(/www/www/htdocs/style/globals.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/photon/lib_ref/pt/ptappaddcallback.html on line 1
Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/globals.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/photon/lib_ref/pt/ptappaddcallback.html on line 1
Warning: main(/www/www/htdocs/style/header.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/photon/lib_ref/pt/ptappaddcallback.html on line 8
Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/header.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/photon/lib_ref/pt/ptappaddcallback.html on line 8
Add a callback to an application's callback list
void PtAppAddCallback(
unsigned long cb_type,
int (*func)(void*,PtCallbackInfo_t*),
void *data );
- cb_type
- The name of the callback list you want to add the function
to. For example, Pt_CB_APP_EXIT.
- func
- A pointer to the function you want to add. The function takes
this form: int (*func)(PtCallbackInfo_t *, void *).
- data
- A pointer to data that you want to pass as the second argument
to the function.
ph
This function adds a callback to the application's callback list.
For a list of application callbacks, see
PtAppSetResources().
For more information, see the
Manipulating Resources
in Application Code chapter of the Photon Programmer's Guide.
- 0
- Success.
- -1
- An error occurred.
int exit_cb(void *data,
PtCallbackInfo_t *cbinfo)
{
printf( "I\'m exiting\n" );
return( Pt_CONTINUE );
};
...
PtAppAddCallback(Pt_CB_APP_EXIT, exit_cb, NULL);
Photon
Safety: | |
Interrupt handler |
No |
Signal handler |
No |
Thread |
No |
PtAppGetResources(),
PtAppGetResource(),
PtAppRemoveCallback(),
PtAppSetResource(),
PtAppSetResources(),
PtSetArg().
Warning: main(/www/www/htdocs/style/footer.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/photon/lib_ref/pt/ptappaddcallback.html on line 134
Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/footer.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/photon/lib_ref/pt/ptappaddcallback.html on line 134