modules.cxx

来自「PTypes (C++ Portable Types Library) is a」· CXX 代码 · 共 67 行

CXX
67
字号
/* * *  C++ Portable Types Library (PTypes) *  Version 1.7.5   Released 9-Mar-2003 * *  Copyright (c) 2001, 2002, 2003 Hovik Melikyan * *  http://www.melikyan.com/ptypes/ *  http://ptypes.sourceforge.net/ * */#include "request.h"#include "modules.h"USING_PTYPEShandler_info* method_list;handler_info* path_list;handler_info* file_list;handler_info::handler_info(handler_info* inext, void* icallback, const string& iparam)    : next(inext), callback(icallback), param(iparam)  {}void add_method_handler(const string& method, method_callback cb){    method_list = new handler_info(method_list, (void*)cb, method);}void add_path_handler(const string& path, path_callback cb){    path_list = new handler_info(path_list, (void*)cb, path);}void add_file_handler(const string& ext, file_callback cb){    file_list = new handler_info(file_list, (void*)cb, ext);}handler_info* find_handler(handler_info* list, const string& param){    while (list != 0)    {        if (list->param == param)            return list;        list = list->next;    }    return 0;}void init_handlers(){    ADD_PATH_HANDLER("/.about", handle_about);}

⌨️ 快捷键说明

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