source: trunk/src/shlwapi/url.cpp@ 4081

Last change on this file since 4081 was 4081, checked in by sandervl, 25 years ago

resync with Wine 20000801

File size: 35.5 KB
Line 
1/* $Id: url.cpp,v 1.6 2000-08-24 09:32:45 sandervl Exp $ */
2
3/*
4 * Win32 Lightweight SHELL32 API for OS/2
5 *
6 * 2000/04/20 Patrick Haller (haller@zebra.fh-weingarten.de)
7 *
8 * @(#) url.cpp 1.0.0 2000/04/20 PH Start from scratch
9 */
10
11
12/*****************************************************************************
13 * Remark *
14 *****************************************************************************
15
16 */
17
18
19/*****************************************************************************
20 * Includes *
21 *****************************************************************************/
22
23#include <odin.h>
24#include <odinwrap.h>
25#include <os2sel.h>
26
27#include <string.h>
28#include <ctype.h>
29#include <wctype.h>
30#include <wcstr.h>
31#define HAVE_WCTYPE_H
32
33#include <winreg.h>
34
35#include <heapstring.h>
36#include <misc.h>
37#include <win\shell.h>
38#include <win\winerror.h>
39
40#include "shlwapi_odin.h"
41
42ODINDEBUGCHANNEL(SHLWAPI-URL)
43
44
45/*****************************************************************************
46 * Defines *
47 *****************************************************************************/
48
49
50typedef struct tagURLSCHEME
51{
52 LPSTR pszName; /* such as http:// */
53 BOOL flagOpaque; /* has a double-slash '// */
54 BOOL flagNoHistory; /* usually not in history of browsers */
55 DWORD dwType; /* URL type */
56
57} URLSCHEME, *PURLSCHEME;
58
59
60typedef enum tagURLIS
61{
62 URLIS_APPLIABLE, /* Attempt to determine a valid scheme for the URL. */
63 URLIS_DIRECTORY, /* Does the URL string end with a directory? */
64 URLIS_FILEURL, /* Is the URL a file URL? */
65 URLIS_HASQUERY, /* Does the URL have an appended query string? */
66 URLIS_NOHISTORY, /* Is the URL a "No History" URL? */
67 URLIS_OPAQUE, /* Is the URL opaque? */
68 URLIS_URL /* Is the URL valid? */
69} URLIS;
70
71
72static URLSCHEME arrUrlSchemes[] =
73{ /* scheme opaque hist type */
74 {"http://", FALSE, FALSE, 0},
75 {"https://", FALSE, FALSE, 0},
76 {"shttp://", FALSE, FALSE, 0},
77 {"file://", FALSE, FALSE, 0},
78 {"ftp://", FALSE, FALSE, 0},
79 {"telnet://", FALSE, TRUE, 0},
80 {"news://", FALSE, TRUE, 0},
81 {"snews://", FALSE, TRUE, 0},
82 {"mailto:", TRUE, TRUE, 0},
83 {"gopher://", FALSE, FALSE, 0},
84 {"wais://", FALSE, FALSE, 0},
85};
86
87
88
89
90/*****************************************************************************
91 * Name : UrlApplyScheme
92 * Purpose : Takes a URL string, determines a scheme for it, and returns a
93 * string with an appropriate prefix.
94 * Parameters: pszIn [in] A NULL-terminated URL string.
95 * pszOut [out] A buffer to receive a NULL-terminated string,
96 * set to the URL specified by pszIn, converted
97 * to the standard scheme://URL_string format.
98 * pcchOut [in/out] Address of a value set to the number of
99 * characters in the pszOut buffer. When the
100 * function returns, the value depends on whether
101 * the function is successful or returns
102 * E_POINTER. For other return values, the value
103 * of this parameter is meaningless.
104 * dwFlags [in] Flags that specify how to determine the
105 * scheme. The following flags can be combined.
106 * URL_APPLY_DEFAULT
107 * Apply the default scheme if UrlApplyScheme
108 * can't determine one. The default prefix is
109 * stored in the registry but is typically "http".
110 * URL_APPLY_GUESSSCHEME
111 * Attempt to determine the scheme by examining
112 * pszIn.
113 * URL_APPLY_GUESSFILE
114 * Attempt to determine a file URL from pszIn.
115 * URL_APPLY_FORCEAPPLY
116 * Force UrlApplyScheme to determine a scheme
117 * for pszIn.
118 * Variables :
119 * Result : S_OK A scheme was determined. pszOut points to a string
120 * containing the URL with the scheme's prefix. The value
121 * of pcchOut is set to the number of characters in the
122 * string, not counting the terminating NULL character.
123 * S_FALSE There were no errors, but no prefix was prepended.
124 * E_POINTER The buffer was too small. The value of pcchOut is
125 * set to the minimum number of characters that the
126 * buffer must be able to contain, including the
127 * terminating NULL character.
128 * Other errors - A standard OLE error value is returned.
129 * Remark : If the URL has a valid scheme, the string will not be modified.
130 * However, almost any combination of two or more characters
131 * followed by a colon will be parsed as a scheme. Valid
132 * characters include some common punctuation marks, such as ".".
133 * If your input string fits this description, UrlApplyScheme may
134 * treat it as valid and not apply a scheme. To force the function
135 * to apply a scheme to a URL, set the URL_APPLY_FORCEAPPLY and
136 * URL_APPLY_DEFAULT flags in dwFlags. This combination of flags
137 * forces the function to apply a scheme to the URL. Typically,
138 * the function will not be able to determine a valid scheme. The
139 * second flag guarantees that, if no valid scheme can be
140 * determined, the function will apply the default scheme to the URL.
141 * Status : PARTIALLY IMPLEMENTED UNTESTED
142 *
143 * Author : Patrick Haller [Thu, 2000/04/20 19:46]
144 *****************************************************************************/
145
146ODINFUNCTION4(HRESULT, UrlApplySchemeA,
147 LPCSTR, pszIn,
148 LPSTR, pszOut,
149 LPDWORD, pcchOut,
150 DWORD, dwFlags)
151{
152 dprintf(("not implemented."));
153
154 strncpy(pszOut,
155 pszIn,
156 *pcchOut);
157 *pcchOut = 0;
158
159 return S_OK;
160}
161
162
163/**
164 * @status partially
165 */
166ODINFUNCTION4(HRESULT, UrlApplySchemeW,
167 LPCWSTR, pszIn,
168 LPWSTR, pszOut,
169 LPDWORD, pcchOut,
170 DWORD, dwFlags)
171{
172 dprintf(("not implemented."));
173
174 wcsncpy((wchar_t*)pszOut,
175 (wchar_t*)pszIn,
176 *pcchOut);
177 *pcchOut = 0;
178
179 return S_OK;
180}
181
182
183/*****************************************************************************
184 * Name : UrlCanonicalize
185 * Purpose : Takes a URL string and converts it into canonical form.
186 * Parameters: pszUrl [in] Pointer to a URL string. If it does not refer
187 * to a file, it must include a valid scheme such
188 * as "http://".
189 * pszCanonicalized [out] A pointer to a NULL-terminated string
190 * used to return the converted URL.
191 * pcchCanonicalized [out] The number of characters in
192 * pszCanonicalized.
193 * dwFlags [in] Flags that specify how the URL will be
194 * converted to canonical form. The
195 * following flags can be combined.
196 * URL_DONT_SIMPLIFY
197 * Treat '/./' and '/../' in a URL
198 * string as literal characters, not as
199 * shorthand for navigation. See Remarks
200 * for further discussion.
201 * URL_ESCAPE_PERCENT
202 * Convert any occurrence of '%' to
203 * its escape sequence.
204 * URL_ESCAPE_SPACES_ONLY
205 * Replace only spaces with escape
206 * sequences. This flag takes precedence
207 * over URL_ESCAPE_UNSAFE, but does not
208 * apply to opaque URLs.
209 * URL_ESCAPE_UNSAFE
210 * Replace unsafe values with their escape
211 * sequences. This flag applies to all URLs,
212 * including opaque URLs.
213 * URL_PLUGGABLE_PROTOCOL
214 * Combine URLs with client-defined
215 * pluggable protocols, according to the W3C
216 * specification. This flag does not apply
217 * to standard protocols such as ftp, http,
218 * gopher, and so on. If this flag is set,
219 * UrlCombine will not simplify URLs, so
220 * there is no need to also set
221 * URL_DONT_SIMPLIFY.
222 * URL_UNESCAPE
223 * Unescape any escape sequences that the
224 * URLs contain, with two exceptions. The
225 * escape sequences for '?' and '#' will
226 * not be unescaped. If one of the
227 * URL_ESCAPE_XXX flags is also set, the two
228 * URLs will unescaped, then combined, then
229 * escaped.
230 * Variables :
231 * Result : Returns S_OK if successful, or a standard OLE error
232 * value otherwise.
233 * Remark : This function will do such tasks as replacing unsafe characters
234 * with their escape sequences and collapsing sequences like "..\...".
235 * If a URL string contains '/../' or '/./', UrlCanonicalize
236 * will normally treat the characters as indicating navigation in
237 * the URL hierarchy. The function will simplify the URLs before
238 * combining them. For instance "/hello/cruel/../world" will be
239 * simplified to "/hello/world". If the URL_DONT_SIMPLIFY flag is
240 * set in dwFlags, the function will not simplify URLs. In this
241 * case, "/hello/cruel/../world" will be left as is.
242 * Status :
243 *
244 * Author : Patrick Haller [Thu, 2000/04/20 19:49]
245 *****************************************************************************/
246
247ODINFUNCTION4(HRESULT, UrlCanonicalizeA,
248 LPCSTR, pszUrl,
249 LPSTR, pszCanonicalized,
250 LPDWORD, pcchCanonicalized,
251 DWORD, dwFlags)
252{
253 dprintf(("not implemented."));
254
255 return S_OK;
256}
257
258
259/**
260 * @status stub
261 */
262ODINFUNCTION4(HRESULT, UrlCanonicalizeW,
263 LPCWSTR, pszUrl,
264 LPWSTR, pszCanonicalized,
265 LPDWORD, pcchCanonicalized,
266 DWORD, dwFlags)
267{
268 dprintf(("not implemented."));
269
270 return S_OK;
271}
272
273
274
275/*****************************************************************************
276 * Name : UrlCombine
277 * Purpose : Takes a relative URL and its base and returns a URL in canonical form.
278 * Parameters: pszBase [in] Pointer to a string with the base URL.
279 * pszRelative [in] Pointer to a string with the relative URL.
280 * pszCombined [out] Pointer to a buffer to receive a
281 * NULL-terminated string containing the combined URL.
282 * pcchCombined [in/out] Pointer to a value set to the number of
283 * characters in the pszCombined buffer. When the
284 * function returns, the value depends on whether
285 * the function is successful or returns E_POINTER.
286 * For other return values, the value of this
287 * parameter is meaningless.
288 * dwFlags [in] Flags that specify how the URL will be converted
289 * to canonical form. The following flags can be combined.
290 * URL_DONT_SIMPLIFY
291 * Treat '/./' and '/../' in a URL string as literal
292 * characters, not as shorthand for
293 * navigation. See Remarks for further discussion.
294 * URL_ESCAPE_PERCENT
295 * Convert any occurrence of '%' to its escape sequence.
296 * URL_ESCAPE_SPACES_ONLY
297 * Replace only spaces with escape sequences. This flag
298 * takes precedence over
299 * URL_ESCAPE_UNSAFE, but does not apply to opaque URLs.
300 * URL_ESCAPE_UNSAFE
301 * Replace unsafe values with their escape sequences.
302 * This flag applies to all URLs,
303 * including opaque URLs.
304 * URL_PLUGGABLE_PROTOCOL
305 * Combine URLs with client-defined pluggable protocols,
306 * according to the W3C specification. This flag does not
307 * apply to standard protocols such as ftp, http,
308 * gopher, and so on. If this flag is set,
309 * UrlCombine will not simplify URLs, so there is
310 * no need to also set URL_DONT_SIMPLIFY.
311 * URL_UNESCAPE
312 * Unescape any escape sequences that the URLs contain,
313 * with two exceptions. The escape sequences
314 * for '?' and '#' will not be unescaped.
315 * If one of the URL_ESCAPE_XXX flags is also
316 * set, the two URLs will unescaped, then
317 * combined, then escaped.
318 * Variables :
319 * Result : S_OK pszCombined points to a string containing the
320 * combined URLs. The value of pcchCombined is set to
321 * the number of characters in the string, not counting
322 * the terminating NULL character.
323 * E_POINTER The buffer was too small. The value of pcchCombined
324 * is set to the minimum number of characters that the
325 * buffer must be able to contain, including the
326 * terminating NULL character.
327 * Other errors A standard OLE error value is returned.
328 * Remark : SHLWAPI.
329 * Status : STUB UNTESTED
330 *
331 * Author : Patrick Haller [Tue, 2000/04/25 02:02]
332 *****************************************************************************/
333
334ODINFUNCTION5(HRESULT,UrlCombineA,
335 LPCSTR, pszBase,
336 LPCSTR, pszRelative,
337 LPSTR, pszCombined,
338 LPDWORD,pcchCombined,
339 DWORD, dwFlags)
340{
341 dprintf(("not implemented."));
342
343 return S_OK;
344}
345
346
347/**
348 * @status stub
349 */
350ODINFUNCTION5(HRESULT, UrlCombineW,
351 LPCWSTR, pszBase,
352 LPCWSTR, pszRelative,
353 LPWSTR, pszCombined,
354 LPDWORD, pcchCombined,
355 DWORD, dwFlags)
356{
357 dprintf(("not implemented."));
358
359 return S_OK;
360}
361
362
363/*****************************************************************************
364 * Name : UrlCompare
365 * Purpose : Does a case-sensitive comparison of two URL strings.
366 * Parameters: pszURL1 [in] NULL-terminated string with the first URL.
367 * pszURL2 [in] NULL-terminated string with the second URL.
368 * fIgnoreSlash [in] Value that is set to TRUE to have UrlCompare
369 * ignore a trailing '/' character on either or
370 * both URLs.
371 * Variables :
372 * Result : Returns zero if the two strings are equal, apart from a
373 * trailing '\' character if fIgnoreSlash is set to TRUE.
374 * Returns a negative integer if the string pointed to by pszURL1
375 * is less than the string pointed to by pszURL2. Otherwise, it
376 * returns a positive integer.
377 * Remark : SHLWAPI.
378 * For the best results, you should first canonicalize the URLs
379 * with UrlCanonicalize. Then, compare the canonicalized URLs with
380 * UrlCompare.
381 * Status : PARTIALLY IMPLEMENTED UNTESTED
382 *
383 * Author : Patrick Haller [Tue, 2000/04/25 02:02]
384 *****************************************************************************/
385
386ODINFUNCTION3(int, UrlCompareA,
387 LPCSTR, pszURL1,
388 LPCSTR, pszURL2,
389 BOOL, fIgnoreSlash)
390{
391 dprintf(("not correctly implemented."));
392
393 return strcmp(pszURL1,
394 pszURL2);
395}
396
397/**
398 * @status stub
399 */
400ODINFUNCTION3(int, UrlCompareW,
401 LPCWSTR, pszURL1,
402 LPCWSTR, pszURL2,
403 BOOL, fIgnoreSlash)
404{
405 dprintf(("not correctly implemented."));
406
407 return wcscmp((const wchar_t *)pszURL1,
408 (const wchar_t *)pszURL2);
409}
410
411
412/*****************************************************************************
413 * Name : UrlCreateFromPath
414 * Purpose : Takes a DOS path and converts it to a canonicalized URL.
415 * Parameters: pszPath Pointer to the string with the DOS path.
416 * pszUrl Value used to return the URL.
417 * pcchPath Length of pszUrl.
418 * dwReserved Reserved. Set this parameter to NULL.
419 * Variables :
420 * Result : Returns S_FALSE if pszPath is already in URL format. In this
421 * case, pszPath will simply be copied to pszUrl. Otherwise, it
422 * returns S_OK if successful or a standard OLE error value if not.
423 * Remark : SHLWAPI.
424 * Status : STUB UNTESTED
425 *
426 * Author : Patrick Haller [Tue, 2000/04/25 02:02]
427 *****************************************************************************/
428
429ODINFUNCTION4(HRESULT,UrlCreateFromPathA,
430 LPCSTR, pszPath,
431 LPSTR, pszUrl,
432 LPDWORD,pcchUrl,
433 DWORD, dwReserved)
434{
435 dprintf(("not implemented."));
436
437 return S_FALSE;
438}
439
440
441/**
442 * @status stub
443 */
444ODINFUNCTION4(HRESULT,UrlCreateFromPathW,
445 LPCWSTR,pszPath,
446 LPWSTR, pszUrl,
447 LPDWORD,pcchUrl,
448 DWORD, dwReserved)
449{
450 dprintf(("not implemented."));
451
452 return S_FALSE;
453}
454
455
456/*****************************************************************************
457 * Name : UrlEscape
458 * Purpose : Converts unsafe characters, such as spaces, into their
459 * corresponding escape sequences.
460 * Parameters: pszURL [in] Pointer to a NULL-terminated string with the URL.
461 * pszEscaped [out] Pointer to a NULL-terminated string containing
462 * the string pointed to by pszURL, with unsafe
463 * characters converted to their escape sequences.
464 * pcchEscaped [in/out] Number of characters in the buffer pointed
465 * to by pszEscaped. On entry, the value pcchEscaped
466 * points to is set to the size of the buffer.
467 * When the function returns, the value pcchEscaped
468 * points to is set to the number of characters
469 * written to that buffer, not counting the terminating
470 * NULL character. If an E_POINTER error code is
471 * returned, the buffer was too small, and the
472 * value pcchEscaped points to is set to the
473 * required number of characters in the buffer. If
474 * any other errors are returned, the value that
475 * pcchEscaped points to is undefined.
476 * dwFlags [in] Flags that control which characters are escaped.
477 * It can be a combination of the following flags.
478 * Flag Description
479 * URL_DONT_ESCAPE_EXTRA_INFO
480 * Don't convert the # or ? character, or
481 * any characters following them in the
482 * string.
483 * URL_ESCAPE_SPACES_ONLY
484 * Only escape space characters. This
485 * flag cannot be combined with
486 * URL_ESCAPE_PERCENT or
487 * URL_ESCAPE_SEGMENT_ONLY.
488 * URL_ESCAPE_PERCENT
489 * Escape the % character. By default,
490 * this character is not escaped.
491 * URL_ESCAPE_SEGMENT_ONLY
492 * Escape the sections following the
493 * server component, but not the extra
494 * information sections following a # or
495 * ? character.
496 * Variables :
497 * Result : Returns an OLE success code if successful. The value pointed to
498 * by pcchEscaped will be set to the number of characters written
499 * to the output buffer, excluding the terminating NULL. If the
500 * buffer was too small, E_POINTER is returned, and the value
501 * pointed to by pcchEscaped will be set to the required buffer
502 * size. Otherwise, an OLE error value is returned.
503 * Remark : SHLWAPI.
504 * Unsafe characters are those characters that may be altered
505 * during transport across the internet. This functions converts
506 * unsafe characters into their equivalent "%xy" escape sequences.
507 * Status : STUB UNTESTED
508 *
509 * Author : Patrick Haller [Tue, 2000/04/25 02:02]
510 *****************************************************************************/
511
512ODINFUNCTION4(HRESULT, UrlEscapeA,
513 LPCSTR, pszURL,
514 LPSTR, pszEscaped,
515 LPDWORD, pcchEscaped,
516 DWORD, dwFlags)
517{
518 dprintf(("not implemented."));
519
520 return S_FALSE;
521}
522
523
524/**
525 * @status stub
526 */
527ODINFUNCTION4(HRESULT, UrlEscapeW,
528 LPCWSTR, pszURL,
529 LPWSTR, pszEscaped,
530 LPDWORD, pcchEscaped,
531 DWORD, dwFlags)
532{
533 dprintf(("not implemented."));
534
535 return S_FALSE;
536}
537
538
539/*****************************************************************************
540 * Name : UrlGetLocation
541 * Purpose : Retrieves the location from a URL.
542 * Parameters: pszURL [in] Pointer to a NULL-terminated string that contains
543 * the location.
544 * Variables :
545 * Result : Returns a pointer to a NULL-terminated string with the
546 * location, or NULL otherwise.
547 * Remark : SHLWAPI.
548 * The location is the segment of the URL starting with a ? or #
549 * character. If a file URL has a query string, the returned
550 * string includes the query string.
551 * Status : STUB UNTESTED
552 *
553 * Author : Patrick Haller [Tue, 2000/04/25 02:02]
554 *****************************************************************************/
555
556ODINFUNCTION1(LPCSTR, UrlGetLocationA,
557 LPCSTR, pszURL)
558{
559 dprintf(("not implemented."));
560
561 return pszURL;
562}
563
564
565/**
566 * @status stub
567 */
568ODINFUNCTION1(LPCWSTR, UrlGetLocationW,
569 LPCWSTR, pszURL)
570{
571 dprintf(("not implemented."));
572
573 return pszURL;
574}
575
576
577/*****************************************************************************
578 * Name : UrlGetPart
579 * Purpose : Takes a URL string and returns a specified part.
580 * Parameters: pszIn [in] NULL-terminated string that contains the URL.
581 * pszOut [out] A buffer that will receive a NULL-terminated
582 * string with the specified part.
583 * pcchOut [in/out] Address of a value set to the number of
584 * characters in the pszOut buffer. When the
585 * function returns, the value depends on whether
586 * the function is successful or returns E_POINTER.
587 * For other return values, the value of this
588 * parameter is meaningless.
589 * dwPart [in] Flags that specify which part of the URL to retrieve.
590 * It can have one of the following values.
591 * Flag Description
592 * URL_PART_HOSTNAME The host name.
593 * URL_PART_PASSWORD The password.
594 * URL_PART_PORT The port number.
595 * URL_PART_QUERY The query portion of the URL.
596 * URL_PART_SCHEME The URL scheme.
597 * URL_PART_USERNAME The username.
598 *
599 * dwFlags [in] Flag that can be set to keep the URL scheme,
600 * in addition to the part that is specified by dwPart.
601 * Flag Description
602 * URL_PARTFLAG_KEEPSCHEME Keep the URL scheme.
603 * Variables :
604 * Result :
605 * Remark : SHLWAPI.
606 * Returns an OLE success code if successful. The value pointed to
607 * by pcchOut will be set to the number of characters written to
608 * the output buffer, excluding the terminating NULL. If the buffer
609 * was too small, E_POINTER is returned, and the value pointed to
610 * by pcchOut will be set to the minimum number of characters that
611 * the buffer must be able to contain, including the terminating
612 * NULL character. Otherwise, an OLE error value is returned.
613 * Status : STUB UNTESTED
614 *
615 * Author : Patrick Haller [Tue, 2000/04/25 02:02]
616 *****************************************************************************/
617
618ODINFUNCTION5(HRESULT, UrlGetPartA,
619 LPCSTR, pszIn,
620 LPSTR, pszOut,
621 LPDWORD, pcchOut,
622 DWORD, dwPart,
623 DWORD, dwFlags)
624{
625 dprintf(("not implemented."));
626
627 return S_OK;
628}
629
630
631/**
632 * @status stub
633 */
634ODINFUNCTION5(HRESULT, UrlGetPartW,
635 LPCWSTR, pszIn,
636 LPWSTR, pszOut,
637 LPDWORD, pcchOut,
638 DWORD, dwPart,
639 DWORD, dwFlags)
640{
641 dprintf(("not implemented."));
642
643 return S_OK;
644}
645
646
647/*****************************************************************************
648 * Name : UrlHash
649 * Purpose : Hashes a URL string.
650 * Parameters: pszURL [in] Pointer to a NULL-terminated string with the URL.
651 * pbHash [out] Buffer to receive the hashed array.
652 * cbHash [in] Number of elements in pbHash. It should be no larger
653 * than 256.
654 * Variables :
655 * Result : Returns S_OK if successful, or a standard OLE error value otherwise.
656 * Remark : SHLWAPI.
657 * For example, to hash a URL into a single byte, set
658 * cbHash = sizeof(BYTE) and
659 * pbHash = (LPBYTE)&bHashedValue, where bHashedValue is a
660 * one-byte buffer. To hash a URL into a DWORD, set
661 * cbHash = sizeof(DWORD) and
662 * pbHash = (LPBYTE)&dwHashedValue, where dwHashedValue is a
663 * DWORD buffer.
664 * Status : STUB UNTESTED
665 *
666 * Author : Patrick Haller [Tue, 2000/04/25 02:02]
667 *****************************************************************************/
668
669ODINFUNCTION3(HRESULT,UrlHashA,
670 LPCSTR, pszURL,
671 LPBYTE, pbHash,
672 DWORD, cbHash)
673{
674 dprintf(("not implemented."));
675
676 return S_OK;
677}
678
679
680/**
681 * @status stub
682 */
683ODINFUNCTION3(HRESULT,UrlHashW,
684 LPCWSTR,pszURL,
685 LPBYTE, pbHash,
686 DWORD, cbHash)
687{
688 dprintf(("not implemented."));
689
690 return S_OK;
691}
692
693
694/*****************************************************************************
695 * Name : UrlIs
696 * Purpose : Tests whether or not a URL is a specified type.
697 * Parameters: pszUrl [in] Pointer to a string containing the URL.
698 * UrlIs [in] Type of URL to be tested for.
699 * UrlIs can take one of the following values:
700 * URLIS_APPLIABLE Attempt to determine a valid scheme for the URL.
701 * URLIS_DIRECTORY Does the URL string end with a directory?
702 * URLIS_FILEURL Is the URL a file URL?
703 * URLIS_HASQUERY Does the URL have an appended query string?
704 * URLIS_NOHISTORY Is the URL a "No History" URL?
705 * URLIS_OPAQUE Is the URL opaque?
706 * URLIS_URL Is the URL valid?
707 * Variables :
708 * Result : For all but one of the URL types, UrlIs returns TRUE if the URL
709 * is the specified type, or FALSE if not. If UrlIs is set to
710 * URLIS_APPLIABLE, UrlIs will attempt to determine the URL scheme.
711 * If the function is able to determine a scheme, it returns TRUE,
712 * or FALSE otherwise.
713 * Remark : SHLWAPI.
714 * Status : STUB UNTESTED
715 *
716 * Author : Patrick Haller [Tue, 2000/04/25 02:02]
717 *****************************************************************************/
718
719ODINFUNCTION2(BOOL, UrlIsA,
720 LPCSTR, pszUrl,
721 URLIS, UrlIs)
722{
723 dprintf(("not implemented."));
724
725 return TRUE;
726}
727
728
729/**
730 * @status stub
731 */
732ODINFUNCTION2(BOOL, UrlIsW,
733 LPCWSTR, pszUrl,
734 URLIS, UrlIs)
735{
736 dprintf(("not implemented."));
737
738 return TRUE;
739}
740
741/*****************************************************************************
742 * Name : UrlIsNoHistory
743 * Purpose : Returns whether or not a URL is a No History URL.
744 * Parameters: pszURL [in] NULL-terminated string with the URL.
745 * Variables :
746 * Result : Returns a non-zero value if the URL is a No History URL, or zero otherwise.
747 * Remark : SHLWAPI.
748 * A No History URL is a URL that browsers typically do not
749 * include in their navigation history.
750 * Status : STUB UNTESTED
751 *
752 * Author : Patrick Haller [Tue, 2000/04/25 02:02]
753 *****************************************************************************/
754
755ODINFUNCTION1(BOOL, UrlIsNoHistoryA,
756 LPCSTR,pszURL)
757{
758 return UrlIsA(pszURL, URLIS_NOHISTORY);
759}
760
761
762/**
763 * @status stub
764 */
765ODINFUNCTION1(BOOL, UrlIsNoHistoryW,
766 LPCWSTR,pszURL)
767{
768 return UrlIsW(pszURL, URLIS_NOHISTORY);
769}
770
771
772/*****************************************************************************
773 * Name : UrlIsOpaque
774 * Purpose : Returns whether a URL is opaque.
775 * Parameters: pszURL [in] NULL-terminated string with the URL.
776 * Variables :
777 * Result : Returns a non-zero value if the URL is opaque, or zero
778 * otherwise.
779 * Remark : SHLWAPI.
780 * A URL that has a scheme that is not followed by two slashes (//)
781 * is opaque. For example, mailto:xyz@somecompany.com is an opaque
782 * URL. Opaque URLs cannot be separated into the standard
783 * URL heirarchy.
784 * Status : STUB UNTESTED
785 *
786 * Author : Patrick Haller [Tue, 2000/04/25 02:02]
787 *****************************************************************************/
788
789ODINFUNCTION1(BOOL, UrlIsOpaqueA,
790 LPCSTR, pszURL)
791{
792 return UrlIsA(pszURL, URLIS_OPAQUE);
793}
794
795
796/**
797 * @status stub
798 */
799ODINFUNCTION1(BOOL, UrlIsOpaqueW,
800 LPCWSTR,pszURL)
801{
802 return UrlIsW(pszURL, URLIS_OPAQUE);
803}
804
805
806/*****************************************************************************
807 * Name : UrlUnEscape
808 * Purpose : Converts escape sequences back into ordinary characters.
809 * Parameters: pszURL [in/out] Pointer to a NULL-terminated string with the
810 * URL. If dwFlags is set to URL_UNESCAPE_INPLACE,
811 * the converted string is returned through this
812 * parameter.
813 * pszUnEscaped [out] Pointer to a buffer that will receive a
814 * NULL-terminated string containing the
815 * unescaped version of pszURL. If
816 * URL_UNESCAPE_INPLACE is set in dwFlags, this
817 * parameter is ignored.
818 * pcchUnEscaped [in/out] Number of characters in the buffer
819 * pointed to by pcchUnEscaped. On entry, the
820 * value pcchUnEscaped points to is set to the
821 * size of the buffer. If the function returns
822 * a success code, the value that pcchUnEscaped
823 * points to is set to the number of characters
824 * written to that buffer, not counting the
825 * terminating NULL character. If an E_POINTER
826 * error code is returned, the buffer was too
827 * small, and the value pcchUnEscaped points to
828 * is set to the required number of characters
829 * that the buffer must be able to contain. If
830 * any other errors are returned, the value
831 * that pcchUnEscaped points to is undefined.
832 * dwFlags [in] Flags that control which characters are
833 * unescaped. It can be a combination of the
834 * following flags.
835 * Flag Description
836 * URL_DONT_UNESCAPE_EXTRA_INFO
837 * Don't convert the # or ? character,
838 * or any characters following them
839 * in the string.
840 * URL_UNESCAPE_INPLACE Use pszURL to return the converted
841 * string instead of pszUnEscaped.
842 * Variables :
843 * Result : Returns an OLE success code if successful. If the
844 * URL_UNESCAPE_INPLACE flag is not set, the value pointed to by
845 * pcchUnEscaped will be set to the number of characters in the
846 * output buffer pointed to by pszUnEscaped. Returns E_POINTER if
847 * the URL_UNESCAPE_INPLACE flag is not set and the output buffer
848 * is too small. The pcchUnEscaped parameter will be set to the
849 * required buffer size. Otherwise, returns an OLE error value.
850 * Remark : SHLWAPI.UrlUnEscape
851 * An escape sequence has the form "%xy".
852 * Status : STUB UNTESTED
853 *
854 * Author : Patrick Haller [Tue, 2000/04/25 02:02]
855 *****************************************************************************/
856
857ODINFUNCTION4(HRESULT,UrlUnescapeA,
858 LPSTR, pszURL,
859 LPSTR, pszUnEscaped,
860 LPDWORD,pcchUnEscaped,
861 DWORD, dwFlags)
862{
863 dprintf(("not implemented."));
864
865 return S_OK;
866}
867
868
869/**
870 * @status stub
871 */
872ODINFUNCTION4(HRESULT,UrlUnescapeW,
873 LPWSTR, pszURL,
874 LPWSTR, pszUnEscaped,
875 LPDWORD,pcchUnEscaped,
876 DWORD, dwFlags)
877{
878 dprintf(("not implemented."));
879
880 return S_OK;
881}
Note: See TracBrowser for help on using the repository browser.