-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add read file support to C, solve 22
- Loading branch information
1 parent
ae1f9fe
commit 962f334
Showing
7 changed files
with
53 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
C Implementation of Problem 22 | ||
============================== | ||
|
||
View source code :source:`c/src/p0022.c` | ||
|
||
Includes | ||
-------- | ||
|
||
- `utils.h <./utils.html>`__ | ||
|
||
Solution | ||
-------- | ||
|
||
.. c:function:: int cmpstr(const void *a, const void *b) | ||
A wrapper around ``strcmp()`` to adapt it for ``qsort()`` | ||
.. c:function:: unsigned long long p0022() | ||
.. c:function:: int main(int argc, char const *argv[]) | ||
.. note:: | ||
This function is only present in the Python test runner, or when compiling as a standalone program. | ||
It is not present when compiling for the Unity test runner. | ||
.. literalinclude:: ../../c/src/p0022.c | ||
:language: C | ||
:linenos: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
utils.h | ||
======= | ||
|
||
View source code :source:`c/src/include/utils.h` | ||
|
||
.. c:namespace-push:: utils | ||
.. c:function:: char *get_data_file(const char *name) | ||
Return a character array containing thr whole contents of a file found in _data. | ||
.. c:function:: char *get_parent_directory(const char *name, const unsigned int levels) | ||
.. c:namespace-pop:: | ||
.. literalinclude:: ../../c/src/include/utils.h | ||
:language: C | ||
:linenos: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters