eyBuildLib API Reference : eyBuildLib

ebrequest

NAME

ebrequest - process http request

ROUTINES

getPost( ) - get the value of parameter user submit by POST method
getParameter( ) - get the value of parameter user variable
getParameterNext( ) - get the next paramter by "name"
isSetQuery( ) - check a query exist or not
getQeuryNumber( ) - get the number of query in query list (for GET/POST)
getQeuryByIndex( ) - get the query by index
getCookie( ) - get the value of cookie
getCookieNext( ) - get the next paramter by "name"
isSetCookie( ) - check a cookie exist or not
getCookieNumber( ) - get the number of cookie in cookie list (for GET/POST)
getCookieByIndex( ) - get the cookie by index
cgiPrefix( ) - make current cgi prefix string
romPrefix( ) - make current rom prefix string
cgiPrefix2( ) - make current cgi prefix string
romPrefix2( ) - make current rom prefix string
cgiPrefix3( ) - make CGI prefix by current page name
romPrefix3( ) - make ROM prefix by current directory
thisCgiPrefix( ) - make prefix by current page name

DESCRIPTION

process http request

INCLUDE

ebenviron.h

SEE ALSO

ebrespond.h


eyBuildLib : Routines

getPost( )

NAME

getPost( ) - get the value of parameter user submit by POST method

SYNOPSIS

char * getPost
    (
    const char * name
    )

DESCRIPTION

this routine is to get the value of parameter user submit by POST method. Note this routine only return the value content type is "application/x-www-form-urlencoded". For type "multipart/form-data" to upload file or submit a mont of data see dopost( ), getPostItemValue( ).

NOTE

if there are more than one same name items, this routine will retun the last one.

RETURN

pointer to the value of parameter, or "" if not find

SEE ALSO

ebrequest


eyBuildLib : Routines

getParameter( )

NAME

getParameter( ) - get the value of parameter user variable

SYNOPSIS

char * getParameter
    (
    const char * name
    )

DESCRIPTION

this routine is to get the value of parameter user submit by GET/POST method. Note for POST, this routine only return the value content type is "application/x-www-form-urlencoded". For type "multipart/form-data" to upload file or submit a mont of data see dopost( ), getPostItemValue( ).

NOTE

if there are more than one same name items, this routine will retun the last one. If you want to get one by one please see getParameterNext( ) or getQeuryByIndex( ).

RETURN

pointer to the value of parameter, or "" if not find

SEE ALSO

ebrequest, getCookie( ) getParameterNext( ) getQeuryByIndex( )


eyBuildLib : Routines

getParameterNext( )

NAME

getParameterNext( ) - get the next paramter by "name"

SYNOPSIS

char * getParameterNext
    (
    char * name,              /* what to search */
    int *  pstart             /* offset, to search for next */
    )

DESCRIPTION

this routine is search the next paramter by "name", the start index is to specify the offset in the search list.

NOTE

if not found the *pstart will return a number < 0

char *  p;
int     offset;

for (offset=0; offset >=0; )
{
    p = getParameterNext("xxx", &offset);
    print("%s\n", p);
}

RETURN

pointer the value, or blank string "" if not found

SEE ALSO

ebrequest, getCookeNext( )


eyBuildLib : Routines

isSetQuery( )

NAME

isSetQuery( ) - check a query exist or not

SYNOPSIS

BOOL isSetQuery
    (
    char * name
    )

DESCRIPTION

this routine is to check a query exist or not.

NOTE

query name and query value may be blank string(""), but not at the same time. Eg.: "?=v1&n1=&&" means there to item "=v1" and "n1="

RETURN

TRUE/FALSE

SEE ALSO

ebrequest, isSetCookie( )


eyBuildLib : Routines

getQeuryNumber( )

NAME

getQeuryNumber( ) - get the number of query in query list (for GET/POST)

SYNOPSIS

int getQeuryNumber ()

DESCRIPTION

this routine is to return the query number (for GET/POST)

NOTE

not include cookie

RETURN

number of querys.

SEE ALSO

ebrequest, getCookieNumber( )


eyBuildLib : Routines

getQeuryByIndex( )

NAME

getQeuryByIndex( ) - get the query by index

SYNOPSIS

char * getQeuryByIndex
    (
    char * * name,            /* to return the query name */
    int      index            /* index in query list */
    )

DESCRIPTION

this routine is to return the query name and value by index. if the index is out of range, the value name should be set to NULL, and the value should be set to blank string ("").

RETURN

pointer the query item value, or "" if no such item.

SEE ALSO

ebrequest, getCookieByIndex( )


eyBuildLib : Routines

getCookie( )

NAME

getCookie( ) - get the value of cookie

SYNOPSIS

char * getCookie
    (
    const char * name
    )

DESCRIPTION

this routine is to get the value of cookie last occur in cookie list

NOTE

if there are more than one same name items, this routine will retun the last one. If you want to get one by one please see getCookieNext( ) or getCookieByIndex( ).

RETURN

pointer to the value of parameter, or "" if not find

SEE ALSO

ebrequest, getParameter( )


eyBuildLib : Routines

getCookieNext( )

NAME

getCookieNext( ) - get the next paramter by "name"

SYNOPSIS

char * getCookieNext
    (
    char * name,
    int *  pindex
    )

DESCRIPTION

this routine is search the next cookie by "name", the start index is to specify the offset in the search list.

NOTE

if not found the *pstart will return a number < 0

char *  p;
int     offset;

for (offset=0; offset >=0; )
{
    p = getCookieNext("xxx", &offset);
    print("%s\n", p);
}

RETURN

pointer the value, or blank string "" if not found

SEE ALSO

ebrequest, getParameterNext( )


eyBuildLib : Routines

isSetCookie( )

NAME

isSetCookie( ) - check a cookie exist or not

SYNOPSIS

BOOL isSetCookie
    (
    char * name
    )

DESCRIPTION

this routine is to check a cookie exist or not.

NOTE

cookie name and cookie value may be blank string(""), but not at the same time. Eg.: "?=v1&n1=&&" means there to item "=v1" and "n1="

RETURN

TRUE/FALSE

SEE ALSO

ebrequest, isSetQuery( )


eyBuildLib : Routines

getCookieNumber( )

NAME

getCookieNumber( ) - get the number of cookie in cookie list (for GET/POST)

SYNOPSIS

int getCookieNumber ()

DESCRIPTION

this routine is to return the cookie number (for GET/POST)

RETURN

number of cookies.

SEE ALSO

ebrequest, getCookieNumber( )


eyBuildLib : Routines

getCookieByIndex( )

NAME

getCookieByIndex( ) - get the cookie by index

SYNOPSIS

char * getCookieByIndex
    (
    char * * name,
    int      index
    )

DESCRIPTION

this routine is to return the cookie name and value by index. if the index is out of range, the value name should be set to NULL, and the value should be set to blank string ("").

RETURN

pointer the cookie item value, or "" if no such item.

SEE ALSO

ebrequest, getParameterByIndex( )


eyBuildLib : Routines

cgiPrefix( )

NAME

cgiPrefix( ) - make current cgi prefix string

SYNOPSIS

char * cgiPrefix
    (
    char * pname
    )

DESCRIPTION

RETURNS

pointer to a prefix or a blank string ""

SEE ALSO

ebrequest


eyBuildLib : Routines

romPrefix( )

NAME

romPrefix( ) - make current rom prefix string

SYNOPSIS

char * romPrefix
    (
    char * pname
    )

DESCRIPTION

make current rom prefix string

RETURNS

pointer to a prefix or a blank string ""

SEE ALSO

ebrequest


eyBuildLib : Routines

cgiPrefix2( )

NAME

cgiPrefix2( ) - make current cgi prefix string

SYNOPSIS

char * cgiPrefix2
    (
    char * pname,
    char * psub
    )

DESCRIPTION

RETURNS

pointer to a prefix or a blank string ""

SEE ALSO

ebrequest


eyBuildLib : Routines

romPrefix2( )

NAME

romPrefix2( ) - make current rom prefix string

SYNOPSIS

char * romPrefix2
    (
    char * pname,
    char * psub
    )

DESCRIPTION

make current rom prefix string

RETURNS

pointer to a prefix or a blank string ""

SEE ALSO

ebrequest


eyBuildLib : Routines

cgiPrefix3( )

NAME

cgiPrefix3( ) - make CGI prefix by current page name

SYNOPSIS

char * cgiPrefix3
    (
    char * pname,
    char * psub,
    char * curdir
    )

DESCRIPTION

this routine is to make CGI prefix by current directory

RETURNS

return the prefix

SEE ALSO

ebrequest


eyBuildLib : Routines

romPrefix3( )

NAME

romPrefix3( ) - make ROM prefix by current directory

SYNOPSIS

char * romPrefix3
    (
    char * pname,
    char * psub,
    char * curdir
    )

DESCRIPTION

this routine is to make ROM prefix by current directory

RETURNS

return the prefix

SEE ALSO

ebrequest


eyBuildLib : Routines

thisCgiPrefix( )

NAME

thisCgiPrefix( ) - make prefix by current page name

SYNOPSIS

char * thisCgiPrefix ()

DESCRIPTION

this routine is to make CGI prefix by current page name

RETURNS

return the prefix by current page name

SEE ALSO

ebrequest