Skip to content

Commit 202340a

Browse files
committed
Rename sources, headers, and binaries to typical C-style names
- Sources and headers are now prefixed with pdalc_ and are all in lowercase - Removed capi directories - Prefixed tests with test_ - Added pdalc.h
1 parent 026083d commit 202340a

33 files changed

+1231
-235
lines changed

.gitlab-ci.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ test-x64-windows-release:
7676
- set GDAL_DATA=%VCPKG_ROOT%\installed\x64-windows\share\gdal
7777
- set PROJ_LIB=%VCPKG_ROOT%\installed\x64-windows\share\proj4
7878
- copy proj_4_9.dll proj.dll
79-
- "%CI_PROJECT_DIR%/build/build-x64-windows-release/bin/test_pdal_c"
79+
- "%CI_PROJECT_DIR%/build/build-x64-windows-release/bin/test_pdalc"
8080
cache:
8181
key: build-x64-windows-release
8282
paths:
@@ -92,7 +92,7 @@ test-x64-windows-debug:
9292
- set GDAL_DATA=%VCPKG_ROOT%\installed\x64-windows\share\gdal
9393
- set PROJ_LIB=%VCPKG_ROOT%\installed\x64-windows\share\proj4
9494
- copy proj_4_9_d.dll proj.dll
95-
- "%CI_PROJECT_DIR%/build/build-x64-windows-debug/bin/test_pdal_cd"
95+
- "%CI_PROJECT_DIR%/build/build-x64-windows-debug/bin/test_pdalcd"
9696
cache:
9797
key: build-x64-windows-debug
9898
paths:
@@ -180,8 +180,8 @@ build-x64-linux-debug-alpine:
180180
.job_template: &test-linux
181181
stage: test
182182
script:
183-
- rm -rf coverage_pdal_c
184-
- make coverage_pdal_c
183+
- rm -rf coverage_pdalc
184+
- make coverage_pdalc
185185
cache:
186186
key: "$CI_JOB_NAME"
187187
policy: pull
@@ -199,7 +199,7 @@ test-x64-linux-release-alpine:
199199
- cd build/build-x64-linux-release-alpine
200200
artifacts:
201201
paths:
202-
- build/build-x64-linux-release-alpine/coverage_pdal_c
202+
- build/build-x64-linux-release-alpine/coverage_pdalc
203203

204204
test-x64-linux-debug-alpine:
205205
<<: *test-linux
@@ -214,5 +214,5 @@ test-x64-linux-debug-alpine:
214214
- cd build/build-x64-linux-debug-alpine
215215
artifacts:
216216
paths:
217-
- build/build-x64-linux-debug-alpine/coverage_pdal_c
217+
- build/build-x64-linux-debug-alpine/coverage_pdalc
218218

.vscode/launch.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"name": "test_pdal_c x64-windows",
99
"type": "cppvsdbg",
1010
"request": "launch",
11-
"program": "${workspaceFolder}\\build\\x64-windows\\bin\\test_pdal_cd.exe",
11+
"program": "${workspaceFolder}\\build\\x64-windows\\bin\\test_pdalcd.exe",
1212
"args": [],
1313
"stopAtEntry": false,
1414
"cwd": "${env:VCPKG_ROOT}\\installed\\x64-windows\\debug\\bin",

CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,9 @@ if(CMAKE_COMPILER_IS_GNUCXX)
4343
endif()
4444
endif()
4545

46-
add_subdirectory("source/pdal/capi")
46+
add_subdirectory("source/pdal")
4747
add_subdirectory("doc")
4848

4949
include(CTest)
5050
add_subdirectory("tests/data")
51-
add_subdirectory("tests/pdal/capi")
51+
add_subdirectory("tests/pdal")
Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,27 @@
1-
set(TARGET pdal_c)
1+
set(TARGET pdalc)
22

33
find_package(PDAL REQUIRED CONFIG)
44
message(STATUS "Found PDAL ${PDAL_VERSION}")
55

66
set(SOURCES
7-
Config.cpp
8-
DimType.cpp
9-
Pipeline.cpp
10-
PointLayout.cpp
11-
PointView.cpp
12-
PointViewIterator.cpp
7+
pdalc_config.cpp
8+
pdalc_dimtype.cpp
9+
pdalc_pipeline.cpp
10+
pdalc_pointlayout.cpp
11+
pdalc_pointview.cpp
12+
pdalc_pointviewiterator.cpp
1313
)
1414

1515
set(HEADERS
16-
Config.h
17-
Defines.h
18-
DimType.h
19-
Forward.h
20-
Pipeline.h
21-
PointLayout.h
22-
PointView.h
23-
PointViewIterator.h
16+
pdalc.h
17+
pdalc_config.h
18+
pdalc_defines.h
19+
pdalc_dimtype.h
20+
pdalc_forward.h
21+
pdalc_pipeline.h
22+
pdalc_pointlayout.h
23+
pdalc_pointview.h
24+
pdalc_pointviewiterator.h
2425
)
2526

2627
set(DEPENDENCIES

source/pdal/capi/Defines.h

Lines changed: 0 additions & 40 deletions
This file was deleted.

source/pdal/pdalc.h

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
/*
2+
* Copyright (c) Simverge Software LLC - All Rights Reserved
3+
*/
4+
5+
#ifndef PDALC_H
6+
#define PDALC_H
7+
8+
#include "pdalc_config.h"
9+
#include "pdalc_dimtype.h"
10+
#include "pdalc_pipeline.h"
11+
#include "pdalc_pointlayout.h"
12+
#include "pdalc_pointview.h"
13+
#include "pdalc_pointviewiterator.h"
14+
15+
#endif
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* Copyright (c) Simverge Software LLC - All Rights Reserved
33
*/
44

5-
#include "Config.h"
5+
#include "pdalc_config.h"
66

77
#include <pdal/pdal_config.hpp>
88

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22
* Copyright (c) Simverge Software LLC - All Rights Reserved
33
*/
44

5-
#ifndef PDAL_CAPI_CONFIG_H
6-
#define PDAL_CAPI_CONFIG_H
5+
#ifndef PDALC_CONFIG_H
6+
#define PDALC_CONFIG_H
77

8-
#include "Forward.h"
8+
#include "pdalc_forward.h"
99

1010
/**
11-
* @file Config.h
12-
* Functions to PDAL version and configuration information.
11+
* @file pdalc_config.h
12+
* Functions to retrieve PDAL version and configuration information.
1313
*/
1414

1515
#ifdef __cplusplus
@@ -34,7 +34,7 @@ namespace pdal
3434
* @param size The size of the provided buffer
3535
* @return The size of the retrieved version string
3636
*/
37-
PDAL_C_API size_t PDALFullVersionString(char *version, size_t size);
37+
PDALC_API size_t PDALFullVersionString(char *version, size_t size);
3838

3939
/**
4040
* Retrieves the PDAL version string.
@@ -47,7 +47,7 @@ namespace pdal
4747
* @param size The size of the provided buffer
4848
* @return The size of the retrieved version string
4949
*/
50-
PDAL_C_API size_t PDALVersionString(char *version, size_t size);
50+
PDALC_API size_t PDALVersionString(char *version, size_t size);
5151

5252
/**
5353
* Returns an integer representation of the PDAL version.
@@ -59,7 +59,7 @@ namespace pdal
5959
*
6060
* @return An integer representation of the PDAL version
6161
*/
62-
PDAL_C_API int PDALVersionInteger();
62+
PDALC_API int PDALVersionInteger();
6363

6464
/**
6565
* Retrieves PDAL's Git commit SHA1 as a string.
@@ -70,7 +70,7 @@ namespace pdal
7070
* @param size The size of the provided buffer
7171
* @return The size of the retrieved SHA1 string
7272
*/
73-
PDAL_C_API size_t PDALSha1(char *sha1, size_t size);
73+
PDALC_API size_t PDALSha1(char *sha1, size_t size);
7474

7575
/**
7676
* Returns the PDAL major version number.
@@ -79,7 +79,7 @@ namespace pdal
7979
*
8080
* @return The major version
8181
*/
82-
PDAL_C_API int PDALVersionMajor();
82+
PDALC_API int PDALVersionMajor();
8383

8484
/**
8585
* Returns the PDAL minor version number.
@@ -88,7 +88,7 @@ namespace pdal
8888
*
8989
* @return The minor version
9090
*/
91-
PDAL_C_API int PDALVersionMinor();
91+
PDALC_API int PDALVersionMinor();
9292

9393
/**
9494
* Returns the PDAL patch version number.
@@ -97,7 +97,7 @@ namespace pdal
9797
*
9898
* @return The patch version
9999
*/
100-
PDAL_C_API int PDALVersionPatch();
100+
PDALC_API int PDALVersionPatch();
101101

102102
/**
103103
* Retrieves PDAL debugging information.
@@ -108,7 +108,7 @@ namespace pdal
108108
* @param size The size of the provided buffer
109109
* @return The size of the retrieved debugging information
110110
*/
111-
PDAL_C_API size_t PDALDebugInformation(char *info, size_t size);
111+
PDALC_API size_t PDALDebugInformation(char *info, size_t size);
112112

113113
/**
114114
* Retrieves the path to the PDAL installation.
@@ -119,7 +119,7 @@ namespace pdal
119119
* @param size The size of the provided buffer
120120
* @return The size of the retrieved installation path
121121
*/
122-
PDAL_C_API size_t PDALPluginInstallPath(char *path, size_t size);
122+
PDALC_API size_t PDALPluginInstallPath(char *path, size_t size);
123123

124124
#ifdef __cplusplus
125125
}

source/pdal/pdalc_defines.h

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
/*
2+
* Copyright (c) Simverge Software LLC - All Rights Reserved
3+
*/
4+
5+
#ifndef PDALC_DEFINES_H
6+
#define PDALC_DEFINES_H
7+
8+
// Visual Studio
9+
#if defined(_MSC_VER)
10+
#define PDALC_EXPORT_API __declspec(dllexport)
11+
#define PDALC_IMPORT_API __declspec(dllimport)
12+
#define PDALC_STATIC_API
13+
14+
// GCC-compatible
15+
#elif defined(__GNUC__)
16+
#if defined(__ELF__)
17+
#define PDALC_EXPORT_API __attribute__((visibility("default")))
18+
#define PDALC_IMPORT_API __attribute__((visibility("default")))
19+
#define PDALC_STATIC_API __attribute__((visibility("default")))
20+
// Use symbols compatible with Visual Studio in Windows
21+
#elif defined(_WIN32)
22+
#define PDALC_EXPORT_API __declspec(dllexport)
23+
#define PDALC_IMPORT_API __declspec(dllimport)
24+
#define PDALC_STATIC_API
25+
// Unknown platform
26+
#else
27+
#define PDALC_EXPORT_API
28+
#define PDALC_IMPORT_API
29+
#define PDALC_STATIC_API
30+
#endif
31+
32+
// Unknown compiler
33+
#else
34+
#define PDALC_EXPORT_API
35+
#define PDALC_IMPORT_API
36+
#define PDALC_STATIC_API
37+
38+
#endif
39+
40+
#endif
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* Copyright (c) Simverge Software LLC - All Rights Reserved
33
*/
44

5-
#include "DimType.h"
5+
#include "pdal/pdalc_dimtype.h"
66
#include <pdal/DimType.hpp>
77

88
namespace pdal

0 commit comments

Comments
 (0)