File: foundry-build.cpp

package info (click to toggle)
foundry 0.0.20130809-2
  • links: PTS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 632 kB
  • ctags: 2,340
  • sloc: cpp: 6,376; yacc: 366; makefile: 192; lex: 184
file content (35 lines) | stat: -rw-r--r-- 760 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#include "print_visitor.hpp"

#include "build_tree.hpp"

#include <sys/types.h>
#include <dirent.h>

int main(int, char **)
{
        using namespace foundry::build;

        project_ptr proj = new project;

        {
                DIR *d = ::opendir(".");
                if(!d)
                        return 1;

                for(dirent *ent; (ent = ::readdir(d));)
                {
                        if(ent->d_type != DT_REG)
                                continue;
                        file_ptr f = new file;
                        f->name = ent->d_name;
                        proj->inputs.push_back(f);
                }

                ::closedir(d);
        }

        print_visitor p;
        p.descend(proj);

        return 0;
}