File: WebCommon.k

package info (click to toggle)
kaya 0.2.0-6
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 3,012 kB
  • ctags: 1,307
  • sloc: cpp: 6,691; haskell: 4,833; sh: 2,868; yacc: 768; makefile: 700; perl: 87
file content (24 lines) | stat: -rw-r--r-- 734 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
/** -*-C-*-ish
    WebCommon.k Copyright (C) 2004, 2005 Edwin Brady
    (functions split out of Webapp.k by Chris Morris)
    This file is distributed under the terms of the GNU Lesser General
    Public Licence. See COPYING for licence.
*/
/* Functions common to Webapp.k and Webprog.k */

module WebCommon;

import Prelude;

foreign "stdfuns.o" {
    String do_urlencode(Ptr vm, String str) = do_urlencode;
    String do_urldecode(Ptr vm, String str) = do_urldecode;
}

// buggy with UTF8 input/output, needs fixing
// fine as long as literal characters on all sides
"URL encode a string"
public String urlEncode(String x) = do_urlencode(getVM, x);
"URL decode a string"
public String urlDecode(String x) = do_urldecode(getVM, x);