Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Have a clear distinction between public and private/internal API #2137

Merged
merged 1 commit into from
Nov 9, 2023

Conversation

IvanNardi
Copy link
Collaborator

@IvanNardi IvanNardi commented Nov 7, 2023

  1. Public API/headers in src/include/ [as it has always been]
  2. Private API/headers in src/lib/

Try to keep the "ndpi_" prefix only for the public functions

@IvanNardi IvanNardi marked this pull request as draft November 7, 2023 16:55
@IvanNardi IvanNardi force-pushed the private-headers branch 9 times, most recently from 15f9cf9 to 07083d2 Compare November 8, 2023 07:42
@IvanNardi
Copy link
Collaborator Author

IvanNardi commented Nov 8, 2023

For the time being, there is only one private header, ndpi_private.h with both some typedefs/structures and some function declarations. If we need/want, we might have multiple headers...

The most important private structures are struct ndpi_packet_struct and struct ndpi_detection_module_struct, which are already "private" (via NDPI_LIB_COMPILATION)

windows/nDPI.vcxproj Outdated Show resolved Hide resolved
1) Public API/headers in `src/include/` [as it has always been]
2) Private API/headers in `src/lib/`

Try to keep the "ndpi_" prefix only for the public functions
@IvanNardi IvanNardi marked this pull request as ready for review November 9, 2023 08:16
@IvanNardi
Copy link
Collaborator Author

We could/should move a lot more stuff into ndpi_private.h, especially from src/include/ndpi_main.h....

@IvanNardi IvanNardi closed this Nov 9, 2023
@IvanNardi IvanNardi reopened this Nov 9, 2023
Copy link

sonarqubecloud bot commented Nov 9, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

Copy link
Collaborator

@utoni utoni left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good job and a good starting point for further "privatization" of structs and functions. :)

@IvanNardi IvanNardi merged commit b08c787 into ntop:dev Nov 9, 2023
@IvanNardi IvanNardi deleted the private-headers branch November 9, 2023 10:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants