eyBuildLib API Reference : eyBuildLib

ebrequest

NAME

ebrequest - process http request

ROUTINES

ebResetConnectCheck( ) - set call back for connection check
getPost( ) - get the value of parameter user submit by POST method
getParameter( ) - get the value of parameter user submit
getParameterByNameIndex( ) - get the value of same name parameter by index
getParameterNext( ) - get the next parameter 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
getCookieByNameIndex( ) - get the value of same-name-cookie by index
getCookieNext( ) - get the next parameter 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
ebIsInConnection( ) - test this HTTP session is in connection or not.
thisCgiPrefix( ) - make prefix by current page name

DESCRIPTION

process http request

INCLUDE

ebenviron.h

SEE ALSO

ebrespond.h


eyBuildLib : Routines

ebResetConnectCheck( )

NAME

ebResetConnectCheck( ) - set call back for connection check

SYNOPSIS

FUNC_ISCONNECTION ebResetConnectCheck
    (
    FUNC_ISCONNECTION callback,
    void *            args
    )

DESCRIPTION

This routine set call back for connection check.

RETURNS

the old callback routine

SEE ALSO

ebrequest


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 submit

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

getParameterByNameIndex( )

NAME

getParameterByNameIndex( ) - get the value of same name parameter by index

SYNOPSIS

char * getParameterByNameIndex
    (
    const char * name,
    int          index
    )

DESCRIPTION

This routine is to get the value of same name parameter by index of user submit by GET/POST method.

RETURN

pointer the value, or blank string ""

SEE ALSO

ebrequest, getParameter( ), getParameterNext( ), getCookieByNameIndex( )


eyBuildLib : Routines

getParameterNext( )

NAME

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

SYNOPSIS

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

DESCRIPTION

This routine is search the next parameter 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 ""

SEE ALSO

ebrequest, getParameter( ), getCookeNext( )


eyBuildLib : Routines

isSetQuery( )

NAME

isSetQuery( ) - check a query exist or not

SYNOPSIS

BOOL isSetQuery
    (
    const 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 blank string ""

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 blank string ""

SEE ALSO

ebrequest, getParameter( )


eyBuildLib : Routines

getCookieByNameIndex( )

NAME

getCookieByNameIndex( ) - get the value of same-name-cookie by index

SYNOPSIS

char * getCookieByNameIndex
    (
    const char * name,
    int          index
    )

DESCRIPTION

This routine is to get the value of same-name-cookie by index.

RETURN

pointer the value, or blank string ""

SEE ALSO

ebrequest, getCookie( ), getCookieNext( ), getParameterByNameIndex( )


eyBuildLib : Routines

getCookieNext( )

NAME

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

SYNOPSIS

char * getCookieNext
    (
    const 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 ""

SEE ALSO

ebrequest, getParameterNext( )


eyBuildLib : Routines

isSetCookie( )

NAME

isSetCookie( ) - check a cookie exist or not

SYNOPSIS

BOOL isSetCookie
    (
    const 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" will be set to NULL.

RETURN

pointer the cookie item value, or blank string ""

SEE ALSO

ebrequest, getCookie( ), getCookieNext( ), getParameterByIndex( )


eyBuildLib : Routines

cgiPrefix( )

NAME

cgiPrefix( ) - make current cgi prefix string

SYNOPSIS

char * cgiPrefix
    (
    const 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
    (
    const 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
    (
    const char * pname,
    const 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
    (
    const char * pname,
    const 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
    (
    const char * pname,
    const char * psub,
    const 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
    (
    const char * pname,
    const char * psub,
    const char * curdir
    )

DESCRIPTION

This routine is to make ROM prefix by current directory

RETURNS

return the prefix

SEE ALSO

ebrequest


eyBuildLib : Routines

ebIsInConnection( )

NAME

ebIsInConnection( ) - test this HTTP session is in connection or not.

SYNOPSIS

BOOL ebIsInConnection (void)

DESCRIPTION

This routine is to test this HTTP session is in connection or not.

RETURNS

TRUE/FALSE;

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