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

Update native parser bindings #995

Merged
merged 4 commits into from
Mar 23, 2016
Merged

Conversation

ihrwein
Copy link
Contributor

@ihrwein ihrwein commented Mar 22, 2016

This PR contains the following changes:

  • update native parser bindings
  • refactor LogPathOptions to use booleans instead of bitfields (24ebce2)

@ihrwein
Copy link
Contributor Author

ihrwein commented Mar 23, 2016

Somehow travis wants to test the second commit... Please wait with the merge.

Note: I added the void keyword to native_parser_proxy_new(void).

Tibor Benke added 4 commits March 23, 2016 15:30
The aim of this change is to improve the "portability" of LogPathOptions.
A bitfield is a very C like concept, it's implementation compiler
dependent.

The log_pipe_forward_msg() function takes  a LogPathOptions pointer, so
if somebody wants to call it from an other language, the LogPathOptions
type has to be redefined. If LogPathOptions contains bitfields, that
could be a problem.

I didn't find any performance penalty. We always pass around LogPathOptions
pointers, so the only dramatic change is we lose some bytes on a
stackframe.

Signed-off-by: Tibor Benke <tibor.benke@balabit.com>
The original function is static inline, so we need to create a public
alias for it.

This approach certainly works on Linux systems.

Signed-off-by: Tibor Benke <tibor.benke@balabit.com>
We may need that pointer during a parse. The previous solution was flawed
because if the parser was cloned with clone(), the Rust parser didn't
receive the parser at all.

By passing the super pointer to each parse() call, we remove a state
and guarantee, that the pointer is always valid (basically, it's a form
of borrowing).

Signed-off-by: Tibor Benke <ihrwein@gmail.com>
Signed-off-by: Tibor Benke <ihrwein@gmail.com>
@ihrwein
Copy link
Contributor Author

ihrwein commented Mar 23, 2016

Now it will test the last commit :) Again ready for review.

@lbudai lbudai merged commit 0be75c7 into syslog-ng:master Mar 23, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants