git ssb

1+

cel / pngspark



Commit b366059646d0ae1ea73ca6a0598323b4db1fd2cf

Update methods

Charles Lehner committed on 2/10/2015, 6:00:28 PM
Parent: edccdfe157b8cdd74de9028777231dac30cbefe0

Files changed

README.mdchanged
main.cchanged
pngspark.cchanged
pngspark.hchanged
README.mdView
@@ -39,8 +39,10 @@
3939 ## API
4040
4141 Generate pngsparks in your own C programs!
4242
43 +All int methods return 0 on success and nonzero on failure.
44 +
4345 ```c
4446 struct pngspark;
4547 ```
4648 A png spark instance: collection of values and settings.
@@ -60,11 +62,11 @@
6062 ```
6163 Process the values and write as a PNG to a file.
6264
6365 ```c
64-int pngspark_end(struct pngspark *ps);
66 +void pngspark_end(struct pngspark *ps);
6567 ```
66-Release allocated memory for the pngspark. (Does not free `ps`, however).
68 +Release allocated memory for the values of the pngspark. (Does not free `ps`, however).
6769
6870 ## License
6971
7072 MIT
main.cView
@@ -79,10 +79,9 @@
7979
8080 if (pngspark_write(&ps, file) < 0)
8181 return 1;
8282
83- if (pngspark_end(&ps) < 0)
84- return 1;
83 + pngspark_end(&ps);
8584
8685 if (fclose(file) < 0)
8786 err(1, "close %s", filename);
8887
pngspark.cView
@@ -78,10 +78,9 @@
7878 luImageRelease(img);
7979 return ret;
8080 }
8181
82-int pngspark_end(struct pngspark *ps)
82 +void pngspark_end(struct pngspark *ps)
8383 {
8484 free(ps->values);
85- return 0;
8685 }
8786
pngspark.hView
@@ -16,7 +16,7 @@
1616
1717 int pngspark_init(struct pngspark *, size_t, const char *, double);
1818 int pngspark_append(struct pngspark *, double);
1919 int pngspark_write(struct pngspark *, FILE *);
20-int pngspark_end(struct pngspark *);
20 +void pngspark_end(struct pngspark *);
2121
2222 #endif /* __PNGSPARK_H */

Built with git-ssb-web