/*
Copyright (C) 2003-2009, Parrot Foundation.
$Id: test_c.in 37201 2009-03-08 12:07:48Z fperrad $

test for S_ISREG macro
*/

#include <stdio.h>
#include <sys/stat.h>

int
main(int argc, char **argv)
{
    struct stat file_stat;
    struct stat dir_stat;

    if (0 != stat("config/auto/isreg/test_c.in", &file_stat)) {
        puts("file stat failed");
        return 0;
    }

    if (0 != stat("config/auto/isreg", &dir_stat)) {
        puts("dir stat failed");
        return 0;
    }

    if (S_ISREG(file_stat.st_mode) && ! S_ISREG(dir_stat.st_mode)) {
        puts("ok");
    }
    else {
        puts("borken");
    }

    return 0;
}

/*
 * Local variables:
 *   c-file-style: "parrot"
 * End:
 * vim: expandtab shiftwidth=4:
 */
