zoukankan      html  css  js  c++  java
  • mini-httpd源码分析-tdate_parse.h

    ///关联字符串和整数
    struct strlong {
        char* s;
        long l;
    };
    
    ///将字符串中的大写字母转换成小写字母
    static void pound_case(char* str)
    
    //比较stlong类型中字符串*s,用strcmp比较
    static int strlong_compare(const void* v1, const void* v2)
    
    //tab[]是安装字符串s从小到大排序的,n是tab的大小,在tab中查找str
    //找到了返回 1,并将tab中对应str字符串的 l 存储在 lP 中;没有找到,则返回 0.
    static int strlong_search(char* str, struct strlong* tab, int n, long* lP)
    
    //第一个参数字符串代表星期几,第二个参数存储星期几对应的数字
    //给定星期,查找其代表对应的数字
    static int scan_wday(char* str_wday, long* tm_wdayP)
    
    
    //同上,给定月份,查找对应的数字
    static int scan_mon(char* str_mon, long* tm_monP)
    
    //给定年份,是闰年,返回1,不是则返回0
    static int is_leap(int year)
    
    //同mktime函数,将struct *tm时间表达形式转换为time_t形式
    static time_t tm_to_time(struct tm* tmP)
    
    //将字符串str表示的时间,转换为time_t的形式
    time_t tdate_parse(char* str)

    对外接口:

    time_t tdate_parse(char* str)
    将字符串str中的时间、日期信息转换为time_t表示的时间信息。
  • 相关阅读:
    牛客网分糖果
    【bzoj3717】[PA2014]Pakowanie 状压dp
    【bzoj1042】[HAOI2008]硬币购物 背包dp+容斥原理
    [POI2007]堆积木Klo
    【bzoj5018】[Snoi2017]英雄联盟 背包dp
    BZOJ 1492 [NOI2007]
    bzoj 2741 [FOTILE模拟赛] L
    bzoj 1486 最小圈
    计数
    cf 700
  • 原文地址:https://www.cnblogs.com/jokoz/p/4583052.html
Copyright © 2011-2022 走看看