src/SDL_assert.c
author Ozkan Sezer
Thu, 21 Nov 2019 11:50:50 +0300
changeset 13267 a8e016c00f2e
parent 13202 1254722e1722
child 13422 fd6a12de91c7
permissions -rw-r--r--
ran gendynapi.pl after newly added SDL_string.c functions.
slouken@3647
     1
/*
slouken@5535
     2
  Simple DirectMedia Layer
slouken@12503
     3
  Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org>
slouken@3647
     4
slouken@5535
     5
  This software is provided 'as-is', without any express or implied
slouken@5535
     6
  warranty.  In no event will the authors be held liable for any damages
slouken@5535
     7
  arising from the use of this software.
slouken@3647
     8
slouken@5535
     9
  Permission is granted to anyone to use this software for any purpose,
slouken@5535
    10
  including commercial applications, and to alter it and redistribute it
slouken@5535
    11
  freely, subject to the following restrictions:
slouken@3647
    12
slouken@5535
    13
  1. The origin of this software must not be misrepresented; you must not
slouken@5535
    14
     claim that you wrote the original software. If you use this software
slouken@5535
    15
     in a product, an acknowledgment in the product documentation would be
slouken@5535
    16
     appreciated but is not required.
slouken@5535
    17
  2. Altered source versions must be plainly marked as such, and must not be
slouken@5535
    18
     misrepresented as being the original software.
slouken@5535
    19
  3. This notice may not be removed or altered from any source distribution.
slouken@3647
    20
*/
icculus@8093
    21
#include "./SDL_internal.h"
slouken@3647
    22
slouken@7828
    23
#if defined(__WIN32__)
slouken@7828
    24
#include "core/windows/SDL_windows.h"
slouken@7828
    25
#endif
slouken@7828
    26
slouken@3651
    27
#include "SDL.h"
slouken@5006
    28
#include "SDL_atomic.h"
slouken@6621
    29
#include "SDL_messagebox.h"
slouken@6621
    30
#include "SDL_video.h"
slouken@3647
    31
#include "SDL_assert.h"
slouken@4472
    32
#include "SDL_assert_c.h"
slouken@3671
    33
#include "video/SDL_sysvideo.h"
slouken@3647
    34
slouken@5086
    35
#ifdef __WIN32__
slouken@5086
    36
#ifndef WS_OVERLAPPEDWINDOW
slouken@5086
    37
#define WS_OVERLAPPEDWINDOW 0
slouken@5086
    38
#endif
slouken@13139
    39
#else  /* fprintf, etc. */
slouken@3647
    40
#include <stdio.h>
slouken@3647
    41
#include <stdlib.h>
dludwig@8341
    42
#endif
slouken@3647
    43
icculus@11017
    44
#if defined(__EMSCRIPTEN__)
icculus@11017
    45
#include <emscripten.h>
icculus@11017
    46
#endif
icculus@11017
    47
icculus@11017
    48
slouken@11272
    49
static SDL_assert_state SDLCALL
icculus@3670
    50
SDL_PromptAssertion(const SDL_assert_data *data, void *userdata);
icculus@3670
    51
icculus@3670
    52
/*
icculus@3670
    53
 * We keep all triggered assertions in a singly-linked list so we can
slouken@3647
    54
 *  generate a report later.
slouken@3647
    55
 */
icculus@5541
    56
static SDL_assert_data *triggered_assertions = NULL;
icculus@3670
    57
icculus@11015
    58
#ifndef SDL_THREADS_DISABLED
icculus@3670
    59
static SDL_mutex *assertion_mutex = NULL;
icculus@11015
    60
#endif
icculus@11015
    61
icculus@3670
    62
static SDL_AssertionHandler assertion_handler = SDL_PromptAssertion;
icculus@3670
    63
static void *assertion_userdata = NULL;
slouken@3647
    64
icculus@3648
    65
#ifdef __GNUC__
icculus@3661
    66
static void
icculus@3661
    67
debug_print(const char *fmt, ...) __attribute__((format (printf, 1, 2)));
icculus@3648
    68
#endif
icculus@3648
    69
icculus@3648
    70
static void
icculus@3648
    71
debug_print(const char *fmt, ...)
slouken@3647
    72
{
slouken@3647
    73
    va_list ap;
slouken@3647
    74
    va_start(ap, fmt);
slouken@6621
    75
    SDL_LogMessageV(SDL_LOG_CATEGORY_ASSERT, SDL_LOG_PRIORITY_WARN, fmt, ap);
slouken@3647
    76
    va_end(ap);
slouken@3647
    77
}
slouken@3647
    78
slouken@3647
    79
slouken@3647
    80
static void SDL_AddAssertionToReport(SDL_assert_data *data)
slouken@3647
    81
{
slouken@3647
    82
    /* (data) is always a static struct defined with the assert macros, so
slouken@3647
    83
       we don't have to worry about copying or allocating them. */
icculus@5541
    84
    data->trigger_count++;
icculus@5541
    85
    if (data->trigger_count == 1) {  /* not yet added? */
slouken@3647
    86
        data->next = triggered_assertions;
slouken@3647
    87
        triggered_assertions = data;
slouken@3647
    88
    }
slouken@3647
    89
}
slouken@3647
    90
icculus@3670
    91
slouken@3647
    92
static void SDL_GenerateAssertionReport(void)
slouken@3647
    93
{
icculus@5541
    94
    const SDL_assert_data *item = triggered_assertions;
icculus@3670
    95
icculus@3670
    96
    /* only do this if the app hasn't assigned an assertion handler. */
icculus@5541
    97
    if ((item != NULL) && (assertion_handler != SDL_PromptAssertion)) {
slouken@3647
    98
        debug_print("\n\nSDL assertion report.\n");
slouken@3647
    99
        debug_print("All SDL assertions between last init/quit:\n\n");
slouken@3647
   100
icculus@5541
   101
        while (item != NULL) {
slouken@3647
   102
            debug_print(
slouken@3647
   103
                "'%s'\n"
slouken@3647
   104
                "    * %s (%s:%d)\n"
slouken@3647
   105
                "    * triggered %u time%s.\n"
slouken@3647
   106
                "    * always ignore: %s.\n",
slouken@3647
   107
                item->condition, item->function, item->filename,
slouken@3647
   108
                item->linenum, item->trigger_count,
slouken@3647
   109
                (item->trigger_count == 1) ? "" : "s",
slouken@3647
   110
                item->always_ignore ? "yes" : "no");
slouken@3647
   111
            item = item->next;
slouken@3647
   112
        }
slouken@3647
   113
        debug_print("\n");
slouken@3647
   114
icculus@3670
   115
        SDL_ResetAssertionReport();
slouken@3647
   116
    }
slouken@3647
   117
}
slouken@3647
   118
slouken@10616
   119
icculus@13118
   120
/* This is not declared in any header, although it is shared between some
icculus@13118
   121
    parts of SDL, because we don't want anything calling it without an
icculus@13118
   122
    extremely good reason. */
sezeroz@12018
   123
#if defined(__WATCOMC__)
sylvain@13202
   124
extern void SDL_ExitProcess(int exitcode);
sezeroz@12018
   125
#pragma aux SDL_ExitProcess aborts;
sezeroz@12018
   126
#endif
sylvain@13202
   127
extern SDL_NORETURN void SDL_ExitProcess(int exitcode);
icculus@3661
   128
slouken@10616
   129
sezeroz@12018
   130
#if defined(__WATCOMC__)
sezeroz@12961
   131
static void SDL_AbortAssertion (void);
sezeroz@12018
   132
#pragma aux SDL_AbortAssertion aborts;
sezeroz@12018
   133
#endif
icculus@12849
   134
static SDL_NORETURN void SDL_AbortAssertion(void)
icculus@3661
   135
{
icculus@3661
   136
    SDL_Quit();
icculus@3661
   137
    SDL_ExitProcess(42);
icculus@3661
   138
}
icculus@3661
   139
slouken@3647
   140
slouken@11272
   141
static SDL_assert_state SDLCALL
icculus@3670
   142
SDL_PromptAssertion(const SDL_assert_data *data, void *userdata)
slouken@3647
   143
{
icculus@6759
   144
#ifdef __WIN32__
icculus@6759
   145
    #define ENDLINE "\r\n"
icculus@6759
   146
#else
icculus@6759
   147
    #define ENDLINE "\n"
icculus@6759
   148
#endif
icculus@6759
   149
slouken@3647
   150
    const char *envr;
slouken@3657
   151
    SDL_assert_state state = SDL_ASSERTION_ABORT;
slouken@3685
   152
    SDL_Window *window;
slouken@6621
   153
    SDL_MessageBoxData messagebox;
slouken@6621
   154
    SDL_MessageBoxButtonData buttons[] = {
slouken@6621
   155
        {   0,  SDL_ASSERTION_RETRY,            "Retry" },
slouken@6621
   156
        {   0,  SDL_ASSERTION_BREAK,            "Break" },
slouken@6621
   157
        {   0,  SDL_ASSERTION_ABORT,            "Abort" },
slouken@6621
   158
        {   SDL_MESSAGEBOX_BUTTON_ESCAPEKEY_DEFAULT,
slouken@6621
   159
                SDL_ASSERTION_IGNORE,           "Ignore" },
slouken@6621
   160
        {   SDL_MESSAGEBOX_BUTTON_RETURNKEY_DEFAULT,
slouken@6621
   161
                SDL_ASSERTION_ALWAYS_IGNORE,    "Always Ignore" }
slouken@6621
   162
    };
slouken@6621
   163
    char *message;
slouken@6621
   164
    int selected;
slouken@3647
   165
icculus@3670
   166
    (void) userdata;  /* unused in default handler. */
icculus@3670
   167
icculus@12349
   168
    /* !!! FIXME: why is this using SDL_stack_alloc and not just "char message[SDL_MAX_LOG_MESSAGE];" ? */
slouken@6621
   169
    message = SDL_stack_alloc(char, SDL_MAX_LOG_MESSAGE);
slouken@6621
   170
    if (!message) {
slouken@6621
   171
        /* Uh oh, we're in real trouble now... */
slouken@6621
   172
        return SDL_ASSERTION_ABORT;
slouken@6621
   173
    }
slouken@6621
   174
    SDL_snprintf(message, SDL_MAX_LOG_MESSAGE,
icculus@6759
   175
                 "Assertion failure at %s (%s:%d), triggered %u %s:" ENDLINE
icculus@6759
   176
                    "  '%s'",
slouken@6621
   177
                 data->function, data->filename, data->linenum,
slouken@6621
   178
                 data->trigger_count, (data->trigger_count == 1) ? "time" : "times",
slouken@6621
   179
                 data->condition);
slouken@6621
   180
slouken@6621
   181
    debug_print("\n\n%s\n\n", message);
slouken@3647
   182
slouken@3655
   183
    /* let env. variable override, so unit tests won't block in a GUI. */
slouken@3647
   184
    envr = SDL_getenv("SDL_ASSERT");
slouken@3647
   185
    if (envr != NULL) {
slouken@6621
   186
        SDL_stack_free(message);
slouken@6621
   187
slouken@3647
   188
        if (SDL_strcmp(envr, "abort") == 0) {
slouken@3647
   189
            return SDL_ASSERTION_ABORT;
slouken@3647
   190
        } else if (SDL_strcmp(envr, "break") == 0) {
slouken@3647
   191
            return SDL_ASSERTION_BREAK;
slouken@3647
   192
        } else if (SDL_strcmp(envr, "retry") == 0) {
slouken@3647
   193
            return SDL_ASSERTION_RETRY;
slouken@3647
   194
        } else if (SDL_strcmp(envr, "ignore") == 0) {
slouken@3647
   195
            return SDL_ASSERTION_IGNORE;
slouken@3647
   196
        } else if (SDL_strcmp(envr, "always_ignore") == 0) {
slouken@3647
   197
            return SDL_ASSERTION_ALWAYS_IGNORE;
slouken@3647
   198
        } else {
slouken@3647
   199
            return SDL_ASSERTION_ABORT;  /* oh well. */
slouken@3647
   200
        }
slouken@3647
   201
    }
slouken@3647
   202
slouken@3657
   203
    /* Leave fullscreen mode, if possible (scary!) */
slouken@3657
   204
    window = SDL_GetFocusWindow();
slouken@3657
   205
    if (window) {
slouken@3657
   206
        if (SDL_GetWindowFlags(window) & SDL_WINDOW_FULLSCREEN) {
slouken@3657
   207
            SDL_MinimizeWindow(window);
slouken@3657
   208
        } else {
icculus@3670
   209
            /* !!! FIXME: ungrab the input if we're not fullscreen? */
slouken@3657
   210
            /* No need to mess with the window */
slouken@6621
   211
            window = NULL;
slouken@3657
   212
        }
slouken@3657
   213
    }
slouken@3657
   214
slouken@6621
   215
    /* Show a messagebox if we can, otherwise fall back to stdio */
slouken@6621
   216
    SDL_zero(messagebox);
slouken@6621
   217
    messagebox.flags = SDL_MESSAGEBOX_WARNING;
slouken@6621
   218
    messagebox.window = window;
slouken@6621
   219
    messagebox.title = "Assertion Failed";
slouken@6621
   220
    messagebox.message = message;
slouken@6621
   221
    messagebox.numbuttons = SDL_arraysize(buttons);
slouken@6621
   222
    messagebox.buttons = buttons;
slouken@3647
   223
slouken@6621
   224
    if (SDL_ShowMessageBox(&messagebox, &selected) == 0) {
slouken@6621
   225
        if (selected == -1) {
slouken@3657
   226
            state = SDL_ASSERTION_IGNORE;
slouken@6621
   227
        } else {
slouken@6621
   228
            state = (SDL_assert_state)selected;
slouken@3647
   229
        }
slouken@3647
   230
    }
icculus@11017
   231
slouken@6621
   232
    else
slouken@6621
   233
    {
icculus@11017
   234
#if defined(__EMSCRIPTEN__)
icculus@11017
   235
        /* This is nasty, but we can't block on a custom UI. */
icculus@11017
   236
        for ( ; ; ) {
icculus@11017
   237
            SDL_bool okay = SDL_TRUE;
icculus@11017
   238
            char *buf = (char *) EM_ASM_INT({
icculus@11017
   239
                var str =
charlie@12576
   240
                    UTF8ToString($0) + '\n\n' +
icculus@11017
   241
                    'Abort/Retry/Ignore/AlwaysIgnore? [ariA] :';
icculus@11017
   242
                var reply = window.prompt(str, "i");
icculus@11017
   243
                if (reply === null) {
icculus@11017
   244
                    reply = "i";
icculus@11017
   245
                }
icculus@11017
   246
                return allocate(intArrayFromString(reply), 'i8', ALLOC_NORMAL);
icculus@11017
   247
            }, message);
icculus@11017
   248
icculus@11017
   249
            if (SDL_strcmp(buf, "a") == 0) {
icculus@11017
   250
                state = SDL_ASSERTION_ABORT;
icculus@11017
   251
            /* (currently) no break functionality on Emscripten
icculus@11017
   252
            } else if (SDL_strcmp(buf, "b") == 0) {
icculus@11017
   253
                state = SDL_ASSERTION_BREAK; */
icculus@11017
   254
            } else if (SDL_strcmp(buf, "r") == 0) {
icculus@11017
   255
                state = SDL_ASSERTION_RETRY;
icculus@11017
   256
            } else if (SDL_strcmp(buf, "i") == 0) {
icculus@11017
   257
                state = SDL_ASSERTION_IGNORE;
icculus@11017
   258
            } else if (SDL_strcmp(buf, "A") == 0) {
icculus@11017
   259
                state = SDL_ASSERTION_ALWAYS_IGNORE;
icculus@11017
   260
            } else {
icculus@11017
   261
                okay = SDL_FALSE;
icculus@11017
   262
            }
icculus@11017
   263
            free(buf);
icculus@11017
   264
icculus@11017
   265
            if (okay) {
icculus@11017
   266
                break;
icculus@11017
   267
            }
icculus@11017
   268
        }
icculus@11017
   269
#elif defined(HAVE_STDIO_H)
slouken@6621
   270
        /* this is a little hacky. */
slouken@6621
   271
        for ( ; ; ) {
slouken@6621
   272
            char buf[32];
slouken@6621
   273
            fprintf(stderr, "Abort/Break/Retry/Ignore/AlwaysIgnore? [abriA] : ");
slouken@6621
   274
            fflush(stderr);
slouken@6621
   275
            if (fgets(buf, sizeof (buf), stdin) == NULL) {
slouken@6621
   276
                break;
slouken@6621
   277
            }
slouken@6621
   278
slouken@11626
   279
            if (SDL_strncmp(buf, "a", 1) == 0) {
slouken@6621
   280
                state = SDL_ASSERTION_ABORT;
slouken@6621
   281
                break;
slouken@11626
   282
            } else if (SDL_strncmp(buf, "b", 1) == 0) {
slouken@6621
   283
                state = SDL_ASSERTION_BREAK;
slouken@6621
   284
                break;
slouken@11626
   285
            } else if (SDL_strncmp(buf, "r", 1) == 0) {
slouken@6621
   286
                state = SDL_ASSERTION_RETRY;
slouken@6621
   287
                break;
slouken@11626
   288
            } else if (SDL_strncmp(buf, "i", 1) == 0) {
slouken@6621
   289
                state = SDL_ASSERTION_IGNORE;
slouken@6621
   290
                break;
slouken@11626
   291
            } else if (SDL_strncmp(buf, "A", 1) == 0) {
slouken@6621
   292
                state = SDL_ASSERTION_ALWAYS_IGNORE;
slouken@6621
   293
                break;
slouken@6621
   294
            }
slouken@6621
   295
        }
icculus@11017
   296
#endif /* HAVE_STDIO_H */
slouken@6621
   297
    }
slouken@3647
   298
slouken@3657
   299
    /* Re-enter fullscreen mode */
slouken@3657
   300
    if (window) {
slouken@3657
   301
        SDL_RestoreWindow(window);
slouken@3657
   302
    }
slouken@3657
   303
slouken@6621
   304
    SDL_stack_free(message);
slouken@6621
   305
slouken@3657
   306
    return state;
slouken@3647
   307
}
slouken@3647
   308
slouken@3647
   309
slouken@3647
   310
SDL_assert_state
slouken@3655
   311
SDL_ReportAssertion(SDL_assert_data *data, const char *func, const char *file,
slouken@3655
   312
                    int line)
slouken@3647
   313
{
icculus@11015
   314
    SDL_assert_state state = SDL_ASSERTION_IGNORE;
icculus@3661
   315
    static int assertion_running = 0;
icculus@11015
   316
icculus@11015
   317
#ifndef SDL_THREADS_DISABLED
icculus@3662
   318
    static SDL_SpinLock spinlock = 0;
icculus@3662
   319
    SDL_AtomicLock(&spinlock);
icculus@3662
   320
    if (assertion_mutex == NULL) { /* never called SDL_Init()? */
icculus@3662
   321
        assertion_mutex = SDL_CreateMutex();
icculus@3662
   322
        if (assertion_mutex == NULL) {
icculus@3662
   323
            SDL_AtomicUnlock(&spinlock);
icculus@3662
   324
            return SDL_ASSERTION_IGNORE;   /* oh well, I guess. */
icculus@3662
   325
        }
icculus@3662
   326
    }
icculus@3662
   327
    SDL_AtomicUnlock(&spinlock);
icculus@3662
   328
slouken@3647
   329
    if (SDL_LockMutex(assertion_mutex) < 0) {
slouken@3647
   330
        return SDL_ASSERTION_IGNORE;   /* oh well, I guess. */
slouken@3647
   331
    }
icculus@11015
   332
#endif
slouken@3647
   333
slouken@3647
   334
    /* doing this because Visual C is upset over assigning in the macro. */
slouken@3647
   335
    if (data->trigger_count == 0) {
slouken@3647
   336
        data->function = func;
slouken@3655
   337
        data->filename = file;
slouken@3655
   338
        data->linenum = line;
slouken@3647
   339
    }
slouken@3647
   340
slouken@3647
   341
    SDL_AddAssertionToReport(data);
slouken@3647
   342
icculus@3661
   343
    assertion_running++;
icculus@3661
   344
    if (assertion_running > 1) {   /* assert during assert! Abort. */
icculus@3661
   345
        if (assertion_running == 2) {
icculus@3661
   346
            SDL_AbortAssertion();
icculus@3661
   347
        } else if (assertion_running == 3) {  /* Abort asserted! */
icculus@3661
   348
            SDL_ExitProcess(42);
icculus@3661
   349
        } else {
icculus@3661
   350
            while (1) { /* do nothing but spin; what else can you do?! */ }
icculus@3661
   351
        }
slouken@3647
   352
    }
slouken@3647
   353
icculus@3661
   354
    if (!data->always_ignore) {
icculus@3670
   355
        state = assertion_handler(data, assertion_userdata);
icculus@3661
   356
    }
slouken@3647
   357
slouken@3647
   358
    switch (state)
slouken@3647
   359
    {
slouken@3647
   360
        case SDL_ASSERTION_ALWAYS_IGNORE:
slouken@3647
   361
            state = SDL_ASSERTION_IGNORE;
slouken@3647
   362
            data->always_ignore = 1;
slouken@3647
   363
            break;
slouken@3647
   364
slouken@3647
   365
        case SDL_ASSERTION_IGNORE:
slouken@3647
   366
        case SDL_ASSERTION_RETRY:
slouken@3647
   367
        case SDL_ASSERTION_BREAK:
slouken@3647
   368
            break;  /* macro handles these. */
icculus@12865
   369
icculus@12865
   370
        case SDL_ASSERTION_ABORT:
icculus@12865
   371
            SDL_AbortAssertion();
icculus@12865
   372
            /*break;  ...shouldn't return, but oh well. */
slouken@3647
   373
    }
slouken@3647
   374
icculus@3661
   375
    assertion_running--;
icculus@11015
   376
icculus@11015
   377
#ifndef SDL_THREADS_DISABLED
slouken@3647
   378
    SDL_UnlockMutex(assertion_mutex);
icculus@11015
   379
#endif
slouken@3647
   380
slouken@3647
   381
    return state;
slouken@3647
   382
}
slouken@3647
   383
slouken@3647
   384
slouken@3647
   385
void SDL_AssertionsQuit(void)
slouken@3647
   386
{
slouken@3647
   387
    SDL_GenerateAssertionReport();
icculus@11015
   388
#ifndef SDL_THREADS_DISABLED
icculus@3664
   389
    if (assertion_mutex != NULL) {
icculus@3664
   390
        SDL_DestroyMutex(assertion_mutex);
icculus@3664
   391
        assertion_mutex = NULL;
icculus@3664
   392
    }
icculus@11015
   393
#endif
icculus@3670
   394
}
icculus@3670
   395
icculus@3670
   396
void SDL_SetAssertionHandler(SDL_AssertionHandler handler, void *userdata)
icculus@3670
   397
{
icculus@3670
   398
    if (handler != NULL) {
icculus@3670
   399
        assertion_handler = handler;
icculus@3670
   400
        assertion_userdata = userdata;
icculus@3670
   401
    } else {
icculus@3670
   402
        assertion_handler = SDL_PromptAssertion;
icculus@3670
   403
        assertion_userdata = NULL;
icculus@3670
   404
    }
icculus@3670
   405
}
icculus@3670
   406
icculus@3670
   407
const SDL_assert_data *SDL_GetAssertionReport(void)
icculus@3670
   408
{
icculus@3670
   409
    return triggered_assertions;
icculus@3670
   410
}
icculus@3670
   411
icculus@3670
   412
void SDL_ResetAssertionReport(void)
icculus@3670
   413
{
icculus@3670
   414
    SDL_assert_data *next = NULL;
icculus@5541
   415
    SDL_assert_data *item;
icculus@5541
   416
    for (item = triggered_assertions; item != NULL; item = next) {
icculus@3670
   417
        next = (SDL_assert_data *) item->next;
icculus@3670
   418
        item->always_ignore = SDL_FALSE;
icculus@3670
   419
        item->trigger_count = 0;
icculus@3670
   420
        item->next = NULL;
icculus@3670
   421
    }
icculus@3670
   422
icculus@5541
   423
    triggered_assertions = NULL;
slouken@3647
   424
}
slouken@3647
   425
icculus@8167
   426
SDL_AssertionHandler SDL_GetDefaultAssertionHandler(void)
icculus@8167
   427
{
icculus@8167
   428
    return SDL_PromptAssertion;
icculus@8167
   429
}
icculus@8167
   430
icculus@8167
   431
SDL_AssertionHandler SDL_GetAssertionHandler(void **userdata)
icculus@8167
   432
{
icculus@8167
   433
    if (userdata != NULL) {
icculus@8167
   434
        *userdata = assertion_userdata;
icculus@8167
   435
    }
icculus@8167
   436
    return assertion_handler;
icculus@8167
   437
}
icculus@8167
   438
slouken@3647
   439
/* vi: set ts=4 sw=4 expandtab: */