~ubuntu-branches/ubuntu/raring/haserl/raring

« back to all changes in this revision

Viewing changes to src/h_error.c

  • Committer: Bazaar Package Importer
  • Author(s): Chow Loong Jin
  • Date: 2011-05-11 01:53:02 UTC
  • mfrom: (0.1.2 sid) (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20110511015302-xr0yki5ivh3dz4g5
Tags: 0.9.29-1
Initial release (Closes: #611445)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
 * --------------------------------------------------------------------------
3
 
 * Error functions for haserl
4
 
 * Copyright (c) 2003-2006 Nathan Angelacos (nangel@users.sourceforge.net)
5
 
 *
6
 
 * This program is free software; you can redistribute it and/or modify it under
7
 
 * the terms of the GNU General Public License, version 2, as published by the Free
8
 
 * Software Foundation.
9
 
 *
10
 
 * This program is distributed in the hope that it will be useful, but WITHOUT
11
 
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12
 
 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
13
 
 * more details.
14
 
 *
15
 
 * You should have received a copy of the GNU General Public License along with
16
 
 * this program; if not, write to the Free Software Foundation, Inc., 59
17
 
 * Temple Place, Suite 330, Boston, MA 02111-1307 USA
18
 
 *
19
 
 * -------------------------------------------------------------------------
20
 
 */
 
1
/* --------------------------------------------------------------------------
 
2
 * Copyright 2003-2011 (inclusive) Nathan Angelacos 
 
3
 *                   (nangel@users.sourceforge.net)
 
4
 * 
 
5
 *   This file is part of haserl.
 
6
 *
 
7
 *   Haserl is free software: you can redistribute it and/or modify
 
8
 *   it under the terms of the GNU General Public License version 2,
 
9
 *   as published by the Free Software Foundation.
 
10
 *
 
11
 *   Haserl is distributed in the hope that it will be useful,
 
12
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
 
13
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
14
 *   GNU General Public License for more details.
 
15
 *
 
16
 *   You should have received a copy of the GNU General Public License
 
17
 *   along with haserl.  If not, see <http://www.gnu.org/licenses/>.
 
18
 *
 
19
 * ------------------------------------------------------------------------ */
21
20
 
22
21
#if HAVE_CONFIG_H
23
22
#include <config.h>
66
65
void
67
66
die_with_message (void *sp, char *where, const char *s, ...)
68
67
{
69
 
  #ifndef JUST_LUACSHELL
 
68
#ifndef JUST_LUACSHELL
70
69
  script_t *script = sp;
71
 
  #endif
 
70
#endif
72
71
  va_list p;
73
72
  FILE *fo = stderr;
74
73
 
85
84
      va_start (p, s);
86
85
      vfprintf (fo, s, p);
87
86
      va_end (p);
88
 
      #ifndef JUST_LUACSHELL
 
87
#ifndef JUST_LUACSHELL
89
88
      if (where && sp)
90
 
        {
 
89
        {
91
90
          fprintf (fo, " near line %d of %s\n",
92
91
                   count_lines (script->buf, script->size, where),
93
92
                   script->name);
94
93
        }
95
 
      #endif
 
94
#endif
96
95
      printf ("\n");
97
96
 
98
97
      if (getenv ("REQUEST_METHOD"))