MCPcopy Create free account
hub / github.com/LASzip/LASzip / main

Function main

example/laszipdllexample.cpp:128–4205  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

126#define EXAMPLE EXAMPLE_SIXTEEN
127
128int main(int argc, char *argv[])
129{
130 laszip_U32 i;
131 double start_time = 0.0;
132 char* file_name_in = 0;
133 char* file_name_out = 0;
134
135 // load LASzip DLL
136
137 if (laszip_load_dll())
138 {
139 fprintf(stderr,"DLL ERROR: loading LASzip DLL\n");
140 byebye(true, argc==1);
141 }
142
143 // get version of LASzip DLL
144
145 laszip_U8 version_major;
146 laszip_U8 version_minor;
147 laszip_U16 version_revision;
148 laszip_U32 version_build;
149
150 if (laszip_get_version(&version_major, &version_minor, &version_revision, &version_build))
151 {
152 fprintf(stderr,"DLL ERROR: getting LASzip DLL version number\n");
153 byebye(true, argc==1);
154 }
155
156 fprintf(stderr,"LASzip DLL v%d.%d r%d (build %d)\n", (int)version_major, (int)version_minor, (int)version_revision, (int)version_build);
157
158 if (argc == 1)
159 {
160 char file_name[256];
161 fprintf(stderr,"%s is better run in the command line\n", argv[0]);
162 fprintf(stderr,"enter input file%s: ", ((EXAMPLE == EXAMPLE_THREE) ? " (not used)" : "")); fgets(file_name, 256, stdin);
163 file_name[strlen(file_name)-1] = '\0';
164 file_name_in = LASCopyString(file_name);
165 fprintf(stderr,"enter output file: "); fgets(file_name, 256, stdin);
166 file_name[strlen(file_name)-1] = '\0';
167 file_name_out = LASCopyString(file_name);
168 }
169 else if (argc == 3)
170 {
171 file_name_in = LASCopyString(argv[1]);
172 file_name_out = LASCopyString(argv[2]);
173 }
174 else
175 {
176 if ((argc != 2) || (strcmp(argv[1], "-h") != 0))
177 {
178 fprintf(stderr, "ERROR: cannot understand arguments\n");
179 }
180 usage();
181 }
182
183 start_time = taketime();
184
185 if (EXAMPLE == EXAMPLE_ONE)

Callers

nothing calls this directly

Calls 15

laszip_load_dllFunction · 0.85
byebyeFunction · 0.85
laszip_get_versionFunction · 0.85
usageFunction · 0.85
laszip_createFunction · 0.85
laszip_open_readerFunction · 0.85
laszip_get_point_pointerFunction · 0.85
laszip_set_headerFunction · 0.85
laszip_open_writerFunction · 0.85
laszip_read_pointFunction · 0.85
laszip_set_pointFunction · 0.85

Tested by

no test coverage detected