-
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.
- Loading branch information
Showing
5 changed files
with
54 additions
and
51 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#include "texttypes.h" | ||
|
||
bool strmatch(ccpc begin, ccpc end, ccpc str) { | ||
ccp p; | ||
ccp q; | ||
for (p = begin, q = str; p < end and *q and *p == *q; p++, q++); | ||
return p == end and not *q; | ||
} |
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,44 @@ | ||
#pragma once | ||
|
||
#include <stdlib.h> | ||
|
||
typedef char const* ccp; //!< Pointer to a constant string. | ||
typedef ccp const ccpc; //!< Constant pointer to a constant string. | ||
|
||
/*! Integer number. | ||
* | ||
* \tparam T Integer type. | ||
* \tparam base Integer base. | ||
*/ | ||
template <class T, size_t base> | ||
struct Number { | ||
T value; //!< Value. | ||
}; | ||
|
||
/*! Boolean. | ||
* | ||
* \tparam truth Truth value. | ||
*/ | ||
template <ccp truth> | ||
struct Bool { | ||
bool value; //!< Value. | ||
}; | ||
|
||
/*! Category. | ||
* | ||
* \tparam T Integer type. | ||
* \tparam . | ||
*/ | ||
template <class T, ccp* labels> | ||
struct Category { | ||
T value; //!< Value. | ||
}; | ||
|
||
|
||
/*! String comparison. | ||
* | ||
* \param[in] begin Pointer to the first C string. | ||
* \param[in] end Pointer to end of the first C string. | ||
* \param[in] str Pointer to the second C string. | ||
*/ | ||
bool strmatch(ccpc begin, ccpc end, ccpc str); |
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