?? ares_compat.c
字號:
/*******************************************************************************//* This file has been modified by Sergio Perez Alca駃z <serpeal@upvnet.upv.es> *//* Departamento de Inform醫ica de Sistemas y Computadores *//* Universidad Polit閏nica de Valencia *//* Valencia (Spain) *//* April 2003 *//*******************************************************************************/#include "ares_private.h"#include <rtl_time.h>extern int gettimeofday(struct timeval *tv, struct timezone *tz);/* Compare S1 and S2, ignoring case, returning less than, equal to or greater than zero if S1 is lexicographically less than, equal to or greater than S2. */intstrcasecmp (const char *s1, const char *s2){ register const unsigned char *p1 = (const unsigned char *) s1; register const unsigned char *p2 = (const unsigned char *) s2; unsigned char c1, c2; if (p1 == p2) return 0; do { c1 = tolower (*p1++); c2 = tolower (*p2++); if (c1 == '\0') break; } while (c1 == c2); return c1 - c2;}char *strdup(const char *s){ char *ns; if(!s) return NULL; ns = malloc(strlen(s)+1); if(ns) strcpy(ns, s); return ns;}time_t time(time_t *tp){ struct timeval time;// long ticks = RetrieveClock();// long secs;// secs = (ticks * 4 + ticks * 8 / 13) / 1000; gettimeofday(&time, NULL); if(tp) *tp = (long) time.tv_sec; return (time_t) time.tv_sec;}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -