MCPcopy Create free account
hub / github.com/acl-dev/acl / main

Function main

lib_acl_cpp/samples/string/string5/main.cpp:82–127  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

80}
81
82int main(int argc, char* argv[])
83{
84 bool use_mmap = false, mapped_read = false;
85 int ch, max = 100000;
86 size_t mapped_off = 0;
87
88 while ((ch = getopt(argc, argv, "hmn:o:R")) > 0)
89 {
90 switch (ch)
91 {
92 case 'h':
93 usage(argv[0]);
94 return 0;
95 case 'm':
96 use_mmap = true;
97 break;
98 case 'o':
99 mapped_off = (size_t) atoi(optarg);
100 break;
101 case 'R':
102 mapped_read = true;
103 break;
104 case 'n':
105 max = atoi(optarg);
106 break;
107 default:
108 break;
109 }
110 }
111
112 if (!use_mmap)
113 test_mem(max);
114 else if (mapped_read)
115 test_mmap_read(mapped_off);
116 else
117 test_mmap_write(max, mapped_off);
118
119 acl::string buf("hello world!");
120
121 // XXX: fixme?
122 // std::cout << buf << std::endl;
123
124 std::string tmp = buf;
125 std::cout << tmp << std::endl;
126 return (0);
127}

Callers

nothing calls this directly

Calls 5

test_mmap_readFunction · 0.85
test_mmap_writeFunction · 0.85
usageFunction · 0.70
test_memFunction · 0.70
getoptFunction · 0.50

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…