Red Hat NETSCAPE ENTERPRISE SERVER 6.1 - NSAPI PROGRAMMER GUIDE Manuel d'utilisateur Page 124

  • Télécharger
  • Ajouter à mon manuel
  • Imprimer
  • Page
    / 148
  • Table des matières
  • MARQUE LIVRES
  • Noté. / 5. Basé sur avis des utilisateurs
Vue de la page 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);
Vue de la page 123
1 2 ... 119 120 121 122 123 124 125 126 127 128 129 ... 147 148

Commentaires sur ces manuels

Pas de commentaire