static void parse_cookie(const char *cookies, char *value, const char *key);
사용하기
parse_cookie(cookies, value, "GOOGLE-LOGIN");
다음은 코드..
#include <stdio.h> static void parse_cookie(const char *cookies, char *value, const char *key) { register const char *p; int key_len; if (!cookies) return; p = cookies; key_len = strlen(key); while (*p) { const char *name; while (*p == ' ' || *p == ';') p++; name = p; do { if (*p == '\0') break; p++; } while (*p != '='); if (p - name == key_len && !strncmp(key, name, key_len)) { register char *c = value; p++; do { if (*p == '\0' || *p == ' ' || *p == ';') break; *c++ = *p++; } while (*p != ' ' && *p != ';'); *c = '\0'; return; } else { do { if (*p == '\0' || *p == ' ' || *p == ';') break; p++; } while (*p != ' ' && *p != ';'); } } } |
'web' 카테고리의 다른 글
webwork(스트러츠2)에서의 chain과 redirect (type) 사용하기 (0) | 2008.04.05 |
---|---|
java jstl에서 c.tld 파일 (0) | 2008.04.05 |
jsp내에서 태그라이브러리 사용시 uri 제대로 사용하기 (0) | 2008.03.26 |
HTTPClient에서의 Cookie 사용하기 (0) | 2008.03.26 |
아파치에서 동적, 정적 모듈 확인하기. (0) | 2007.12.11 |