⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 htmllib.c

📁 基于S3C4510的家庭网关的通讯进程程序源码
💻 C
字号:
/***************************************************************文件名: htmllib.c 功能:动态网页的函数库(html语言编写用标准输入输出流输出)HTML common library functions 完成日期:2004.7.18 **************************************************************/#include <stdio.h>#include "htmllib.h"void htmlHeader(int fd){ write(fd,"<HTML><HEAD><meta http-equiv=Content-Type content=\"text/html;\        charset=gb2312-80\"><META content=\"Microsoft Frontpage 4.0\"    \        name=GENERATOR><META name=ProgId content=\"FrontPage.            \         Editor.Document\"><META http-equiv=Refresh content=15>",226); write(fd,"<script language=\"JavaScript\">",30);
 write(fd,"if(document.images){var dot_off=new Image();dot_off.          \                  src=\"/dot_off.gif\";var dot_on=new Image();dot_on.             \         src=\"/dot_on.gif\";}</script>",129); write(fd,"<style type=text/css>A:link{text-decoration: none;}A:visited{ \        text-decoration: none;}A:hover{text-decoration: underline;}",120);  write(fd,"</style><TITLE>智园慧家</TITLE></HEAD>",38);}	void htmlBody(int fd){	 write(fd,"<BODY bgColor=#ffffff><FORM method=\"get\" action=\"/cgi-bin/ \           cgi_home.cgi\">",72); write(fd,"<TABLE height=81 cellSpacing=0 cellPadding=0 width=762 align= \           center border=0>",77); write(fd,"<TBODY><TR vAlign=top><TD vAlign=top width=121 bgColor=       \            #ffffff height=81><DIV align=center><img border=\"0\" src=    \           \"mylogo.gif\" width=123 height=117></DIV></TD>",156); write(fd,"<TD vAlign=top width=631 height=81><img border=\"0\" src=     \           \"headflower.gif\" width=715 height=89>",92);                 \ write(fd,"<b><font size=\"5\" face=\"新宋体\" color=#000000>            \           欢迎进入智园慧家——智能家居系统</font></b></TD></TR>           \           </TBODY></TABLE>",115);}void htmlFormStr(int fd){  write(fd,"<table><tr><td><table border=0 height=297 width=775><tr>     \          <td align=middle valign=top width=217 height=357>              \          <TABLE border=0 cellPadding=0 cellSpacing=0  width=\"90%\">    \          <TR><TD height=30 width=\"20%\">&nbsp;&nbsp;&nbsp;",209);  write(fd,"<a href=\"/home.html\" onMouseOver=\"if(document.images)     \          document.column1.src=dot_on.src;\" onMouseOut=\"               \          if(document.images) document.column1. src=dot_off.src;\">      \          <IMG border=0 height=15 name=column1 src=\"dot_off.gif\"       \           width=39>",219);  write(fd,"</TD><TD width=\"32%\" height=30><A href=\"/home.html\">     \          <font size=\"3\" color=#008080>家电控制</FONT></A></TD></TR>   \          <TR><TD height=30 width=\"20%\"> &nbsp;&nbsp;&nbsp;",158);  write(fd,"<a href=\"/home.html\" onMouseOver=\"if(document.images)     \          document.column2.src=dot_on.src;\" onMouseOut=\"               \          if(document.images) document.column2.src=dot_off.src;\">       \          <IMG border=0 height=15 name=column2 src=\"dot_off.gif\"       \          width=39>",219);  write(fd,"</TD><TD width=\"32%\" height=30><A href=\"/home.html\">     \          <font size=\"3\" color=#008080>管理中心</FONT></A></TD></TR>   \          <TR><TD height=30 width=\"20%\"> &nbsp;&nbsp;&nbsp;",158);  write(fd,"<a href=\"/home.html\" onMouseOver=\"if(document.images)     \           document. column3.src=dot_on.src;\" onMouseOut=\"              \          if(document.images) document.column3.src=dot_off.src;\">       \          <IMG border=0 height=15 name=column3 src=\"dot_off.gif\"       \          width=39>",219);  write(fd,"</TD><TD width=\"32%\" height=30><A href=\"/home.html\">     \          <font size=\"3\" color=#008080>小区论坛</FONT></A></TD></TR>   \          </table>",118);  write(fd,"<td valign=top width=779 height=357>",36);}void htmlFormEnd(int fd){  write(fd,"</td></tr></table></FORM>",25);  write(fd,"<table align=center width=769 border=0 cellspacing=0         \         cellpadding=0><tr><td bgcolor=#ffffff height=22 width=997>      \         <marquee scrollamount=2 width=860 height=14>",155);         write(fd,"<a href=\"http://ercdc.bjpu.edu.cn\" target=\         \         "_blank\">如您已看过小区给您的信息请按确认按钮 网关上的信息     \         指示灯将随即熄灭 智园慧家谢谢您的使用 如有问题请与我们联系      \         </a></marquee></td></tr></table>",196);	}void htmlAnniuQuit(int fd){	 write(fd,"<TABLE align=center border=0 cellPadding=0 cellSpacing=0      \        width=116 height=58><TD height=1 width=114><TR height=222        \        width=\"20%\"><td height=28 width=114>&nbsp;&nbsp;&nbsp;<IMG     \        border=0 height=27 name=c1 src=\"dot_red.gif\" width=35>",228); write(fd,"</TR><TR width=\"32%\" height=222><FONT color=#000000><td     \        height=29 width=114>紧急按钮关闭</FONT></TR></table>",108);}void htmlAnniuStr(int fd,unsigned char *text,unsigned int size){  write(fd,"<TABLE align=center border=0 cellPadding=0 cellSpacing=0     \         width=267 height=58><TD height=1 width=265><TR height=222       \         width=\"20%\"><td height=28 width=265>&nbsp;&nbsp;&nbsp;<IMG    \         border=0 height=27 name=c1 src=\"dot.gif\" width=35>",224);  write(fd,"</TR><TR width=\"32%\" height=222><FONT color=#000000><td    \         height=29 width=265>紧急按钮启动</FONT><font face=\"宋体\"      \         size=\"1\"><b>",125);  write(fd,text,size);  write(fd,"</b></font></TR></table>",24);}void htmlFooter(int fd){		write(fd,"</TR></TABLE></BODY></HTML>",27);}void htmlText2(int fd){ write(fd,"<table border=\"1\" width=\"101%\" bgcolor=\"#fff4ff\"><tr>  \	<td width=\"14%\">子网号</td><td width=\"14%\">节点号</td>",107);	write(fd,"<td width=\"14%\">节点数据</td><td width=\"15%\">时间 \	</td> <td width=\"15%\">电池电量(毫伏)</td><td width=\"15%\">   \	节点功能</td><td width=\"15%\">节点状态</td></tr>",152);	}void htmlText(int fd,char *text,int size){	write(fd,"<P>",3);	write(fd,text,size);	write(fd,"</P>",4);}void htmlText1(int fd,char *text,int size){  write(fd,"<P><img border=0 src=\"NEW1.gif\" width=25 height=12>",51);  write(fd,text,size);  write(fd,"</P>",4);}void htmlText3(int fd){	write(fd,"<tr>",4);}void htmlText4(int fd,char *text,int size){	write(fd,"<center><table border=0 cellpadding=0 cellspacing=0    \	width=\"104%\" bgcolor=\"#5b8fda\"><tr>",87);	write(fd,text,size);	write(fd,"</tr></table></center>",22);}void htmlTextHead(int fd){ write(fd,"<table border=0 cellpadding=0 cellspacing=0 width=\"105%\"    \        bgcolor=\"#ECF3FF\"><tr><td width=\"100%\">",96);	}void htmlTextEnd(int fd){ write(fd,"</td></tr></table>",18);}void htmlTextHead1(int fd){ write(fd,"<table border=0 cellpadding=0 cellspacing=0 width=\"105%\"    \        bgcolor=\"#F4FFF4\"><tr><td width=\"100%\">",96);	}void htmlTextEnd1(int fd){	write(fd,"</td></tr></table>",18);}void htmlText5(int fd,char *text,int size){	write(fd,"<td width=\"15%\">",16);	write(fd,text,size);	write(fd,"</td>",5);}void htmlText6(int fd){	write(fd,"</tr>",5);}void htmlText7(int fd){	write(fd,"</table>",8);}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -