Changeset 40 in Main for trunk/Module


Ignore:
Timestamp:
Sep 17, 2024, 9:31:08 PM (2 months ago)
Author:
Nishi
Message:

use dll for windows build

Location:
trunk/Module
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Module/Makefile

    r39 r40  
    44
    55.PHONY: all clean
    6 .SUFFIXES: .c .o .so
     6.SUFFIXES: .c .o $(LIB)
    77
    8 all: mod_example.so mod_cgi.so
     8all: mod_cgi$(LIB)
    99
    10 .o.so:
     10.o$(LIB):
    1111        $(CC) $(LDFLAGS) -shared -o $@ $< ../Common/common.a $(LIBS)
    1212
    1313.c.o:
    14         $(CC) $(CFLAGS) -fPIC -c -o $@ $<
     14        $(CC) $(CFLAGS) -c -o $@ $<
    1515
    1616clean:
  • trunk/Module/mod_cgi.c

    r39 r40  
    22
    33#include "../Server/tw_module.h"
     4
     5#include <cm_string.h>
    46
    57int mod_init(struct tw_config* config, struct tw_tool* tools) {
     
    1012
    1113int mod_config(struct tw_tool* tools, char** argv, int argc) {
    12         printf("args %d\n", argc);
    13         return TW_CONFIG_ERROR;
     14        if(cm_strcaseequ(argv[0], "AllowCGI")) {
     15                return TW_CONFIG_PARSED;
     16        }
     17        return TW_CONFIG_NOTME;
    1418}
    1519
  • trunk/Module/mod_example.c

    r20 r40  
    11/* $Id$ */
     2/* This module will accept all directives, and always return 403 on the access. */
    23
    34#include "../Server/tw_module.h"
     
    910}
    1011
     12int mod_config(struct tw_tool* tools, char** argv, int argc) { return TW_CONFIG_PARSED; }
     13
    1114int mod_request(struct tw_tool* tools, struct tw_http_request* req, struct tw_http_response* res) { return TW_MODULE_ERROR(403); }
Note: See TracChangeset for help on using the changeset viewer.