- Visual C++源码
- Visual Basic源码
- C++ Builder源码
- Java源码
- Delphi源码
- C/C++源码
- PHP源码
- Perl源码
- Python源码
- Asm源码
- Pascal源码
- Borland C++源码
- Others源码
- SQL源码
- VBScript源码
- JavaScript源码
- ASP/ASPX源码
- C#源码
- Flash/ActionScript源码
- matlab源码
- PowerBuilder源码
- LabView源码
- Flex源码
- MathCAD源码
- VBA源码
- IDL源码
- Lisp/Scheme源码
- VHDL源码
- Objective-C源码
- Fortran源码
- tcl/tk源码
- QT源码
TSCOPE.C
资源名称:ertos.rar [点击查看]
上传用户:sunrenlu
上传日期:2022-06-13
资源大小:1419k
文件大小:2k
源码类别:
操作系统开发
开发平台:
DOS
- /*
- * tscope - thermometer scopt demonstrates a simple web page with real-time graphs
- */
- #include <dos.h>
- #include <stdio.h>
- #include <rtos.h>
- #include <sio.h>
- #include <string.h>
- #include <mem.h>
- #include <telnetd.h>
- #include <ftpd.h>
- #include <httpd.h>
- #include <smtpcli.h>
- #include <process.h>
- #include "webpart.h"
- #define EMAILNOTIFY "email.notify"
- static void (*old_init)(char *name, char *value);
- char emailuserid[255] = "";
- /********************************************************************/
- /* our_init - used to read TCP.CFG file
- */
- static void our_init( char *name, char *value )
- {
- int found = 0;
- if ( !stricmp( name, EMAILNOTIFY )) {
- strncpy( emailuserid, value, sizeof( emailuserid));
- emailuserid[ sizeof( emailuserid ) - 1 ] = 0;
- cprintf("Configured email userid to %srn", emailuserid );
- found = 1;
- }
- if ( !found )
- if ( old_init ) (*old_init)( name, value );
- }
- /********************************************************************/
- /* main - setup everything then wait for a keystroke
- */
- main()
- {
- int temp;
- DWORD dummy;
- rt_init( 100 );
- kdebug = 1 ;
- old_init = usr_init;
- usr_init = our_init;
- sock_init();
- cputs("TSCOPE 1.0rn");
- cputs("Copyright (c) 1990, 1999 Erick Engelkern");
- cputs("Press any key to exitrn");
- rt_newthread( ftpdthread, 1,4096, 0, "ftpd" );
- #define MAXHTTPD 5
- rt_newthread( collector, 1,4096, 0, "collector" );
- for ( temp = 0 ; temp < MAXHTTPD; ++temp )
- rt_newthread( httpdthread, (DWORD)&user_proc, 4096, 0, "httpd worker" );
- while ( 1 ) {
- if ( kbhit() ) break;
- rt_sleep( 250 );
- }
- }