Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
mobileproxy clib #226
base: main
Are you sure you want to change the base?
mobileproxy clib #226
Changes from 11 commits
2eaa36b
624a90f
f323528
931027f
53ed6c2
81fc937
c7989b1
f617762
042d9a3
6b16192
0d3f1ee
cde8a2b
6d396e0
68f183f
13220da
4b984e7
ba9cd7e
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We must have a way to return errors. Go Mobile returns a struct instead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jyyi1 you can return a tuple right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, you can return a tuple and paste the header here.
@fortuna, do you mean a more C-friendly way of returning errors, like below?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need a way to return an error meesage.
Also, which design should we use?
I think Go Mobile on ios returns the value and writes the error to an input reference.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I lean towards tuple with two pointers in it. Since we're throwing around unsafe pointers, with the tuple approach the caller doesn't have to do any guesswork around what kind of pointer they've received. But maybe there's a C way to do it? @jyyi1 thoughts?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jyyi1 should we be using errno? https://www.geeksforgeeks.org/error-handling-in-c/#
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
errno
is very Unix specific. But sure, we can introduce our ownerrno
. That's actually my code above, we'll return anint
, and put the proxy into a "output parameter".There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need a way to return an error message too. Errno is not enough.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm going with tuple w/ error message as second optional argument