test-doc.c
上传用户:seven77cht
上传日期:2007-01-04
资源大小:486k
文件大小:2k
- /***************************************
- $Header$
- Document parser test program
- ******************/ /******************
- Written by Andrew M. Bishop
- This file Copyright 1998,99,2000 Andrew M. Bishop
- It may be distributed under the GNU Public License, version 2, or
- any higher version. See section COPYING of the GNU Public license
- for conditions under which this file may be redistributed.
- ***************************************/
- #include <stdio.h>
- #include "wwwoffle.h"
- #include "document.h"
- #include "misc.h"
- int main(int argc,char **argv)
- {
- URL *Url;
- char **list,*refresh;
- int j;
- if(argc==1)
- {fprintf(stderr,"usage: test-doc <URL>n");return(1);}
- Url=SplitURL(argv[1]);
- init_buffer(0);
- ParseDocument(0,Url);
- if((refresh=MetaRefresh()))
- printf("Refresh = %sn",refresh);
- if((list=GetReferences(RefStyleSheet)))
- for(j=0;list[j];j++)
- printf("StyleSheet = %sn",list[j]);
- if((list=GetReferences(RefImage)))
- for(j=0;list[j];j++)
- printf("Image = %sn",list[j]);
- if((list=GetReferences(RefFrame)))
- for(j=0;list[j];j++)
- printf("Frame = %sn",list[j]);
- if((list=GetReferences(RefScript)))
- for(j=0;list[j];j++)
- printf("Script = %sn",list[j]);
- if((list=GetReferences(RefObject)))
- for(j=0;list[j];j++)
- printf("Object = %sn",list[j]);
- if((list=GetReferences(RefInlineObject)))
- for(j=0;list[j];j++)
- printf("InlineObject = %sn",list[j]);
- if((list=GetReferences(RefLink)))
- for(j=0;list[j];j++)
- printf("Link = %sn",list[j]);
- FreeURL(Url);
- return(0);
- }