Cookies Library get_cookiejar()
Programming guideline of WinDom

get_cookie()

NAME

get_cookie() - Look for a cookie in the system cookiejar.

PROTOTYPAGE

int get_cookie( long cookie, long *value);

PARAMETERS

cookie:
cookie identifier to find,

value:
address of the cookie value. A NULL value is possible.

return:
1 if the cookie is found, 0 else.

DESCRIPTION

get_cookie() finds a cookie in the cookiejar. If the system does not support the cookie jar, the function returns always 0. It is possible to test the cookiejar availability with get_cookiejar(). The function returns the address of the cookie value. It is possible to use the NULL value if the cookie value is not used.

EXAMPLES

     /* LDG in memory ? */
     int is_ldg( void) {
     	return get_cookie( 'LDGM', NULL);
     }
     
     /* MiNT version */
     int mint_version( void) {
     	long val;
     	if( get_cookie( 'MiNT', &val))
     		return val;
     	else
     		return 0;
     }
SEE ALSO

get_cookiejar().