HTTP_C.C
资源名称:ertos.rar [点击查看]
上传用户:sunrenlu
上传日期:2022-06-13
资源大小:1419k
文件大小:1k
源码类别:
操作系统开发
开发平台:
DOS
- /*
- * http get client
- * Copyright (c) 1999 Erick Engelke
- */
- #include <stdio.h>
- #include <string.h>
- #include <rtos.h>
- #include <net.h>
- #include <strlst.h>
- #include <http.h>
- void display_list( stringlist *sl )
- {
- void *x;
- char *p;
- p = strlst_getfirst( sl, &x, NULL );
- while ( p != NULL ) {
- cprintf("%srn", p );
- p = strlst_getnext( sl, &x, NULL );
- }
- cprintf("rn");
- }
- int main( int argc, char **argv )
- {
- stringlist *sl;
- rt_init( 100 );
- kdebug = 1;
- sock_init();
- if ( argc < 2 ) {
- cputs("ERROR: http_c //hostname/urlrn");
- exit( 3 );
- }
- if ( http_get( argv[1], 0, &sl, NULL ))
- if ( sl ) display_list( sl );
- if ( sl ) strlst_freeall( sl );
- return( 0 );
- }