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

Pass header & events as null-terminated strings #6

Closed
Youka opened this issue Oct 10, 2014 · 3 comments
Closed

Pass header & events as null-terminated strings #6

Youka opened this issue Oct 10, 2014 · 3 comments

Comments

@Youka
Copy link
Contributor

Youka commented Oct 10, 2014

ASS is a text format, there will be no null character in header or event, so outsourcing character counting is just pushing work to users.

@torque
Copy link
Contributor

torque commented Oct 10, 2014

As I stated in my comments on #5, I don't have a problem with adding an alternative api function that lets the user provide events as a string. But I also don't see a good reason to get rid of the current api function.

edit: in concert with #7, the current assi_addEvent method could be changed to assi_pushEvent

@Youka
Copy link
Contributor Author

Youka commented Oct 11, 2014

The functions with characters counting could just end with _str and call their variable length equivalents with the length parameter calculated by strlen on data - that simple. Though i would prefer they replace the old (->their names) which get _n appended, following the usual C style.

@torque
Copy link
Contributor

torque commented Oct 11, 2014

I don't see a good reason to start appending things on the end of function names, usual C style or not.

I'd like to avoid using _ in identifiers as much as possible. It's useful for visually separating the namespace from the function name, but other than that, it should be perfectly easy to create descriptive function names without needing to append garbled characters to the end.

for example, something like:

int assi_addEventsFromString( const char *eventString );
// Following two functions are interchangeable. If `eventLength == 0`, use
// `strlen` to determine length.
int assi_pushEvent( const char *event );
int assi_pushEventWithLength( const char *event, const unsigned int eventLength );

@Youka Youka closed this as completed Oct 26, 2014
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

No branches or pull requests

2 participants