You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by jlwpc1 <jl...@mail.earthlink.net> on 2000/11/05 19:03:57 UTC

Win32 Path/URL info

From: "William A. Rowe, Jr." <wr...@rowe-clan.net>

> Let's try to get some serious code sharing together
> for the canonical parsing for Apache 2.0, write it from scratch, and
> come to agreement about how it aught to do what we agree it should.
> 

Not _sure_ what you are really after but have you looked at the Win32 OS PathXXX and URLXXX functions?

Why can't you use the OS Shell Functions :

Shell Lightweight Utility APIs

Version 4.71 and later of Shlwapi.dll
Windows NT/2000: Requires Windows 2000 (or Windows NT 4.0 with Internet Explorer 4.0 or later). 
Windows 95/98: Requires Windows 98 (or Windows 95 with Internet Explorer 4.0 or later). 
Header: Declared in shlwapi.h. 
Import Library: shlwapi.lib. 

There are Path Functions already written:
 PathAddBackslash  PathAddExtension  PathAppend  PathBuildRoot 
 PathCanonicalize  PathCombine  PathCommonPrefix  PathCompactPath 
 PathCompactPathEx  PathCreateFromUrl  PathFileExists  PathFindExtension 
 PathFindFileName  PathFindNextComponent  PathFindOnPath 
 PathFindSuffixArray  PathGetArgs  PathGetCharType  PathGetDriveNumber 
 PathIsContentType  PathIsDirectory  PathIsDirectoryEmpy  PathIsFileSpec 
 PathIsHTMLFile  PathIsLFNFileSpec  PathIsNetworkPath  PathIsPrefix 
 PathIsRelative  PathIsRoot  PathIsSameRoot  PathIsSystemFolder 
 PathIsUNC  PathIsUNCServer  PathIsUNCServerShare  PathIsURL 
 PathMakePretty  PathMakeSystemFolder  PathMatchSpec 
 PathParseIconLocation  PathQuoteSpaces  PathRelativePathTo 
 PathRemoveArgs  PathRemoveBackslash  PathRemoveBlanks 
 PathRemoveExtension  PathRemoveFileSpec  PathRenameExtension 
 PathSearchAndQualify  PathSetDlgItemPath  PathSkipRoot  PathStripPath 
 PathStripToRoot  PathUndecorate  PathUnExpandEnvStrings 
 PathUnmakeSystemFolder  PathUnquoteSpaces  SHSkipJunction 
 UrlApplyScheme  UrlCanonicalize  UrlCombine  UrlCompare 
 UrlCreateFromPath  UrlEscape  UrlEscapeSpaces  UrlGetLocation 
 UrlGetPart  UrlHash  UrlIs  UrlIsFileUrl  UrlIsNoHistory  UrlIsOpaque 
 UrlUnescape  UrlUnescapeInPlace 

Also be sure to look at the OS Shell String Functions :
 ChrCmpI  IntlStrEqN  IntlStrEqNI  IntlStrEqWorker  MLLoadLibrary 
 SHStrDup  StrCat  StrCatBuff  StrChr  StrChrI  StrCmp  StrCmpI 
 StrCmpN  StrCmpNI  StrCpy  StrCpyN  StrCSpn  StrCSpnI  StrDup 
 StrFormatByteSize  StrFormatByteSize64  StrFormatKBSize 
 StrFromTimeInterval  StrIsIntlEqual  StrNCat  StrPBrk  StrRChr  StrRChrI 
 StrRetToBuf  StrRetToStr  StrRStrI  StrSpn  StrStr  StrStrI  StrToInt 
 StrToIntEx  StrToInt64Ex  StrTrim  wnsprintf  wvnsprintf

All the above are Win32 OS functions - not C Run Time!

JLW



 




Re: Win32 Path/URL info

Posted by David Reid <dr...@jetnet.co.uk>.
Damn, we have to write an APR portability library as well as APR?????

:)

david

...  They don't have a place
> in an APR portability library, however :-)



RE: Win32 Path/URL info

Posted by "William A. Rowe, Jr." <wr...@rowe-clan.net>.
> From: jlwpc1 [mailto:jlwpc1@mail.earthlink.net]
> Sent: Sunday, November 05, 2000 12:04 PM
> 
> From: "William A. Rowe, Jr." <wr...@rowe-clan.net>
> 
> > Let's try to get some serious code sharing together
> > for the canonical parsing for Apache 2.0, write it from scratch, and
> > come to agreement about how it aught to do what we agree it should.
> > 
> 
> Not _sure_ what you are really after but have you looked at 
> the Win32 OS PathXXX and URLXXX functions?
> 
> Why can't you use the OS Shell Functions :
> 
> Shell Lightweight Utility APIs
> 
> Version 4.71 and later of Shlwapi.dll
> Windows NT/2000: Requires Windows 2000 (or Windows NT 4.0 
> with Internet Explorer 4.0 or later). 
> Windows 95/98: Requires Windows 98 (or Windows 95 with 
> Internet Explorer 4.0 or later). 

Doesn't the requirements alone answer your query?

> Import Library: shlwapi.lib. 
> 
> All the above are Win32 OS functions - not C Run Time!

This is a benefit?  Note that they are not core OS functions
(NTDLL or KERNEL32) but a wrapper that will be subject to
alot of volatility.  If we had a look at the sources to know
they provided what we need with reasonable performance, and
were redistributable with Apache.

I'm not holding my breath.

They are shell functions, not kernel functions.  Wait a moment
while I pull out my 10 foot pole :-)

The point I'm making is that these functions undermine what we 
are trying to eliminate - platform discrepancies.

The question we need to answer in canonical names is this:
how many different ways will Win32, or any other platform,
allow us to bypass comparison between identical paths.  The
Win32 system alone allows the user to insert double slashes,
'this' directories, trailing periods, and does some very
insecure things with charset conversion.  I'm closing holes,
not adopting new api's to expose further holes.

Thanks for pointing them out though - I've used them with
success in some COM component code.  They don't have a place
in an APR portability library, however :-)