Red Hat NETSCAPE ENTERPRISE SERVER 6.1 - NSAPI PROGRAMMER GUIDE Manual do Utilizador Página 124

  • Descarregar
  • Adicionar aos meus manuais
  • Imprimir
  • Página
    / 148
  • Índice
  • MARCADORES
  • Avaliado. / 5. Com base em avaliações de clientes
Vista de página 123
Defining Customized Server-Parsed HTML Tags
124 Netscape Enterprise Server ProgrammersGuide April 2002 (Draft)
length = util_sprintf(buf, "<h1>Hello World! </h1>", client);
if (net_write(sn->csd, buf, length) == IO_ERROR)
{
FREE(buf);
return REQ_ABORTED;
}
FREE(buf);
return REQ_PROCEED;
}
/* FUNCTION : mytag_init
*
* DESCRIPTION: initialization function, calls shtml_add_tag() to
*loadnewtag
*/
#
#ifdef __cplusplus
extern "C"
#endif
int
mytag_init(pblock* pb, Session* sn, Request* rq)
{
intretVal=0;
// NOTE: ALL arguments are required in the shtml_add_tag() function
retVal = shtml_add_tag("HELLO", mytag_con, mytag_des, mytag,
mytag_load, mytag_unload);
return retVal;
}
/* end mytag.c */
Write an Initialization Function to Register the New Tag
In the initialization function for the shared library that defines the new tag, register
the tag using the function
shtml_add_tag.Thesignatureis:
NSAPI_PUBLIC int shtml_add_tag (
const char* tag,
ShtmlTagInstanceLoad ctor,
ShtmlTagInstanceUnload dtor,
ShtmlTagExecuteFunc execFn,
ShtmlTagPageLoadFunc pageLoadFn,
ShtmlTagPageUnLoadFunc pageUnLoadFn);
Vista de página 123
1 2 ... 119 120 121 122 123 124 125 126 127 128 129 ... 147 148

Comentários a estes Manuais

Sem comentários