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/pf/pfassigndllcx.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/pf/pfassigndllcx.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/pf/pfassigndllcx.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/pf/pfassigndllcx.html on line 8
Assign a context to a local font server
#include <font_api.h>
int PfAssignDllCx( struct _Pf_ctrl * context,
fontdll_t dll );
- dll
- A font server context, returned by PfAttachLocalDll().
- context
- A pointer to the font context to use, returned by PfAttachCx() or PfAttachDllCx().
font
This function assigns the dll to the font context, context.
- 0
- Success
- -1
- An error occurred (errno is
set).
- EFAULT
- The font context is NULL
- ENOTSUP
- The platform does not support this operation.
/* A PtHook example. Initializes a client level font server
* instance for any application that invokes PtInit(), and has
* knowledge of this hook.
*/
#include <font_api.h>
#include <photon/PhProto.h>
#include <stdlib.h>
#include <unistd.h>
static fontdll_t dll;
extern struct _Ph_ctrl *_Ph_;
static void cleanup_hook(void)
{ PfAssignDllCx(_Ph_->font, NULL);
PfDetachLocalDll(dll);
dll = NULL;
}
int PtHook(void * data)
{ if(data != NULL)
{ if((dll = PfAttachLocalDll(NULL, NULL)) == NULL)
return(0);
else
{ if(PfAssignDllCx(_Ph_->font, dll) == -1)
{ PfDetachLocalDll(dll);
return(0);
}
else
{ if(access("/dev/fontsleuthctrl", F_OK) == 0)
if(PfAttachSleuthMonitorDll(dll, -1) == -1)
{ PfAssignDllCx(_Ph_->font, NULL);
PfDetachLocalDll(dll);
return(0);
}
if(atexit(cleanup_hook) != 0)
{ PfAssignDllCx(_Ph_->font, NULL);
PfDetachLocalDll(dll);
return(0);
}
}
}
}
else
return(0);
return(1);
}
Photon
Safety: | |
Cancellation point |
No |
Interrupt handler |
No |
Signal handler |
No |
Thread |
Yes |
PfAttachCx(),
PfAttachDllCx(), PfAttachLocalDll()
Fonts chapter
of the Photon Programmer's Guide
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/pf/pfassigndllcx.html on line 177
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/pf/pfassigndllcx.html on line 177