imap/src/osdep/nt/env_nt.c
/* Initialize server
 * Accepts: server name for syslog or NIL
 *	    /etc/services service name or NIL
 *	    alternate /etc/services service name or NIL
 *	    clock interrupt handler
 *	    kiss-of-death interrupt handler
 *	    hangup interrupt handler
 *	    termination interrupt handler
 */
Initialize server
Accepts: server name for syslog or NIL
/etc/services service name or NIL
alternate /etc/services service name or NIL
clock interrupt handler
kiss-of-death interrupt handler
hangup interrupt handler
termination interrupt handler
Initialize server Accepts : server name for syslog or NIL / etc / services service name or NIL alternate / etc / services service name or NIL clock interrupt handler kiss - of - death interrupt handler hangup interrupt handler termination interrupt handler
void server_init (char *server,char *service,char *sslservice,
		  void *clkint,void *kodint,void *hupint,void *trmint,
		  void *staint)
{
  if (!check_nt ()) {
    if (!auth_md5.server) fatal ("Can't run on Windows without MD5 database");
    server_nli = T;		
  }
  if (server && service && sslservice) {
    long port;
    struct servent *sv;
    openlog (server,LOG_PID,LOG_MAIL);
    fclose (stderr);		
    if (((port = tcp_serverport ()) >= 0)) {
      if ((sv = getservbyname (service,"tcp")) && (port == ntohs (sv->s_port)))
	syslog (LOG_DEBUG,"%s service init from %s",service,tcp_clientaddr ());
      else if ((sv = getservbyname (sslservice,"tcp")) &&
	       (port == ntohs (sv->s_port))) {
	syslog (LOG_DEBUG,"%s SSL service init from %s",sslservice,
		tcp_clientaddr ());
	ssl_server_init (server);
      }
      else {			
	syslog (LOG_DEBUG,"port %ld service init from %s",port,
		tcp_clientaddr ());
	if (*server == 's') ssl_server_init (server);
      }
    }
    setmode (fileno (stdin),O_BINARY);
    setmode (fileno (stdout),O_BINARY);
  }
  alarm_rang = clkint;		
  timeBeginPeriod (1000);	
  timeSetEvent (1000,1000,clock_ticked,NIL,TIME_PERIODIC);
}
void server_init ( char * server , char * service , char * sslservice , void * clkint , void * kodint , void * hupint , void * trmint , void * staint ) { if ( ! check_nt ( ) ) { if ( ! auth_md5 . server ) fatal ( " " ) ; server_nli = T ; } if ( server && service && sslservice ) { long port ; struct servent * sv ; openlog ( server , LOG_PID , LOG_MAIL ) ; fclose ( stderr ) ; if ( ( ( port = tcp_serverport ( ) ) >= 0 ) ) { if ( ( sv = getservbyname ( service , " " ) ) && ( port == ntohs ( sv -> s_port ) ) ) syslog ( LOG_DEBUG , " " , service , tcp_clientaddr ( ) ) ; else if ( ( sv = getservbyname ( sslservice , " " ) ) && ( port == ntohs ( sv -> s_port ) ) ) { syslog ( LOG_DEBUG , " " , sslservice , tcp_clientaddr ( ) ) ; ssl_server_init ( server ) ; } else { syslog ( LOG_DEBUG , " " , port , tcp_clientaddr ( ) ) ; if ( * server == ' ' ) ssl_server_init ( server ) ; } } setmode ( fileno ( stdin ) , O_BINARY ) ; setmode ( fileno ( stdout ) , O_BINARY ) ; } alarm_rang = clkint ; timeBeginPeriod ( 1000 ) ; timeSetEvent ( 1000 , 1000 , clock_ticked , NIL , TIME_PERIODIC ) ; }
Initialize server
 Accepts: server name for syslog or NIL
          /etc/services service name or NIL
          alternate /etc/services service name or NIL
          clock interrupt handler
          kiss-of-death interrupt handler
          hangup interrupt handler
          termination interrupt handler
Initialize server Accepts : server name for syslog or NIL / etc / services service name or NIL alternate / etc / services service name or NIL clock interrupt handler kiss - of - death interrupt handler hangup interrupt handler termination interrupt handler
/* Windows server not logged in */ /* only do this if for init call */ /* set server name in syslog */ /* possibly save a process ID */ /* Use SSL if SSL service, or if server starts with "s" and not service */ /* not service or SSL service port */ /* make sure stdout does binary */ /* note the clock interrupt */ /* set the timer interval */