1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97
|
<!--plsfield:text-->
<HTML><HEAD>
<TITLE>C API Reference -- Ns_SetUrlToFileProc</TITLE>
<LINK rel=Previous href="c-ch351.htm">
<LINK rel=ToC href="toc.htm">
<LINK rel=Index href="master.htm">
<LINK rel=Next href="c-ch353.htm">
</HEAD><BODY BGCOLOR="#ffffff"><A NAME="topofpage"></A>
<TABLE WIDTH=100%>
<TR>
<TD ALIGN=LEFT>
<A NAME="topofpage"></A> <IMG SRC="as-c-sm.gif">
</TD>
<TD ALIGN=RIGHT>
<A href="c-ch351.htm"><IMG BORDER="0" src=navbprev.gif alt="[ Previous ]"></A>
<A href=toc.htm> <IMG BORDER="0" src=navbhome.gif alt="[ Contents ]"></A>
<A href=master.htm> <IMG BORDER="0" src=navbhelp.gif alt="[ Index ]"></A>
<A href="c-ch353.htm"> <IMG BORDER="0" src=navbnext.gif alt="[ Next ]"></A>
<A name="7983"> </A>
</TD>
</TR>
</TABLE>
<a name="131567">
</a><h3>Ns_SetUrlToFileProc</h3>
<a name="131568">
</a><h4>Overview</h4>
Customize relative file mapping
<a name="47754">
</a><a name="133444">
</a><h4>Syntax</h4>
<pre> <a name="47756"></a>void Ns_SetUrlToFileProc(
<a name="47757"></a>char *hserver,
<a name="47758"></a>Ns_UrlToFileProc *proc
<a name="47759"></a>);
</pre><p><a name="134845">
</a><h4>Description</h4>
<p><a name="850386">
</a>Ns_SetUrlToFileProc() sets the procedure pointed to by <code>proc</code> to be called by Ns_UrlToFile() to map a URL to a file pathname. The interface of the procedure pointed to by proc must have the same interface as Ns_UrlToFile().</p>
<p><a name="850536">
</a>A NULL <code>proc</code> argument to Ns_SetUrlToFileProc() causes Ns_UrlToFile() afterwards to call a default procedure.</p>
<a name="850397">
</a><h4>Examples</h4>
<pre> <a name="850399"></a>int
<a name="850400"></a>Ns_ModuleInit(char *hServer, char *hModule)
<a name="850401"></a>{
<a name="850402"></a> Ns_SetUrlToFileProc(hServer, AliasedUrlToFile);
<a name="850403"></a>
<a name="850404"></a> return NS_OK;
<a name="850405"></a>}
<a name="850406"></a>
<a name="850407"></a>static int
<a name="850408"></a>AliasedUrlToFile(Ns_DString *dest, char *hServer, char *relpath)
<a name="850409"></a>{
<a name="850410"></a> char *pageRoot;
<a name="850411"></a>
<a name="850412"></a> /*
<a name="850413"></a> * construct dest from hServer and relpath
<a name="850414"></a> */
<a name="850415"></a>
<a name="850416"></a> pageRoot = Ns_PageRoot(hServer);
<a name="850417"></a> Ns_MakePath(dest, pageRoot, relpath, NULL);
<a name="850418"></a>
<a name="850419"></a> return NS_OK;
<a name="850420"></a>}
</pre><p><p><a name="850421">
</a></p>
<p><a name="850422">
</a>See the alias C example for a more comprehensive example.</p>
<a name="850542">
</a><h4>See also</h4>
<p><a name="850544">
</a>Ns_UrlToFile()</p>
<p><a name="850563">
</a>Ns_MakePath()</p>
<TABLE BORDER="2" CELLPADDING="1" width="100%">
<TR><TD COLSPAN=3><P ALIGN=Center>
<IMG SRC="bluebult.gif">
<A HREF="#topofpage">
<FONT SIZE=-1>Top of Page</FONT></A>
<IMG SRC="bluebult.gif">
</TD></TR>
<TR><TD COLSPAN=3><P ALIGN=Center>
<A href="c-ch351.htm">
<IMG BORDER="0" src=navbprev.gif alt="[ Previous ]"></A>
<A href=toc.htm>
<IMG BORDER="0" src=navbhome.gif alt="[ Contents ]"></A>
<A href=master.htm>
<IMG BORDER="0" src=navbhelp.gif alt="[ Index ]"></A>
<A href="c-ch353.htm">
<IMG BORDER="0" src=navbnext.gif alt="[ Next ]"></A>
<BR align=center>
<FONT size=-1>Copyright © 1998-99 America Online,
Inc.</FONT>
</TD></TR></TABLE></BODY></HTML><!--plsfield:end-->
|