Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

added evpsgi.h

  • Loading branch information...
commit 139aa3f9301d28feff7575a735babeb8c1a8fab0 1 parent 6c72275
Masayoshi Sekimura authored
Showing with 38 additions and 20 deletions.
  1. +16 −20 evpsgi.c
  2. +22 −0 evpsgi.h
36 evpsgi.c
View
@@ -1,21 +1,27 @@
+/* -*- Mode: C; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */
/*
+ * evpsgi - PSGI server with libevent httpd
+ *
+ * http://github.com/sekimura/evpsgi
+ *
+ * Copyright 2009 Masayoshi Sekimura. All rights reserved.
+ *
+ * This library is free software; you can redistribute it and/or modify it
+ * under the same terms as Perl itself
+ *
+ * Authors:
+ * Masayoshi Sekimura <sekimura@gmail.com>
+ */
+
+#include "evpsgi.h"
-gcc -g -Werror -std=c99 -o evpsgi evpsgi.c -levent `perl -MExtUtils::Embed -e ccopts -e ldopts`
-
-For Mac OS X (port)
-
-gcc -levent -o evpsgi evpsgi.c -g -Wall `perl -MExtUtils::Embed -e ccopts -e ldopts | sed -e's/-arch ppc//'` -I/opt/local/include -L/opt/local/lib'
-
-*/
-
-#include <sys/types.h>
#include <sys/time.h>
#include <sys/queue.h>
#include <stdlib.h>
#include <err.h>
#include <stdarg.h>
-#include <netdb.h>
+#include <netdb.h>
#include <event.h>
#include <evhttp.h>
@@ -23,7 +29,6 @@ gcc -levent -o evpsgi evpsgi.c -g -Wall `perl -MExtUtils::Embed -e ccopts -e l
#include "perl.h"
#include "XSUB.h"
-
/* generated by perl −MExtUtils::Embed −e xsinit −− −o xsinit.c */
EXTERN_C void xs_init (pTHX);
@@ -90,15 +95,6 @@ static PerlInterpreter *perlinterp = NULL;
struct settings settings;
SV *app;
-struct settings {
- char *file;
- char *alias;
- u_short port;
- char *inter;
- char *server_name;
- bool alias_is_root;
-};
-
SV* new_env(struct evhttp_request *req) {
AV *version;
HV *env;
22 evpsgi.h
View
@@ -0,0 +1,22 @@
+/* -*- Mode: C; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <sys/types.h>
+#include <stdbool.h>
+
+/**
+ * Globally accessible settings as derived from the commandline.
+ */
+struct settings {
+ char *file;
+ char *alias;
+ u_short port;
+ char *inter;
+ char *server_name;
+ bool alias_is_root;
+};
+extern struct settings settings;
+
Please sign in to comment.
Something went wrong with that request. Please try again.