Skip to content

Instantly share code, notes, and snippets.

@alex-ameen
Last active March 18, 2019 08:41
Show Gist options
  • Save alex-ameen/bb4d821d7163dc4f2f8173dbe603cb46 to your computer and use it in GitHub Desktop.
Save alex-ameen/bb4d821d7163dc4f2f8173dbe603cb46 to your computer and use it in GitHub Desktop.
Lorem Ipsum inputs for DVP HW7.1
/* 10K, 100K, and 1000K strings of filler. */
/* Offset versions are unaligned the signified bytecount. */
char * lorem10; /* Alias for lorem10_off0 */
char * lorem10_off0, * lorem10_off1, * lorem10_off2, * lorem10_off3;
char * lorem10_off4, * lorem10_off5, * lorem10_off6, * lorem10_off7;
char * lorem100; /* Alias for lorem100_off0 */
char * lorem100_off0, * lorem100_off1, * lorem100_off2, * lorem100_off3;
char * lorem100_off4, * lorem100_off5, * lorem100_off6, * lorem100_off7;
char * lorem1000; /* Alias for lorem1000_off0 */
char * lorem1000_off0, * lorem1000_off1, * lorem1000_off2, * lorem1000_off3;
char * lorem1000_off4, * lorem1000_off5, * lorem1000_off6, * lorem1000_off7;
/* All of the Macros. Plenty of fun expansions. */
#define REPEAT0(_S) ""
#define REPEAT1(_S) _S REPEAT0 (_S)
#define REPEAT2(_S) _S REPEAT1 (_S)
#define REPEAT3(_S) _S REPEAT2 (_S)
#define REPEAT4(_S) _S REPEAT3 (_S)
#define REPEAT5(_S) _S REPEAT4 (_S)
#define REPEAT6(_S) _S REPEAT5 (_S)
#define REPEAT7(_S) _S REPEAT6 (_S)
#define REPEAT8(_S) _S REPEAT7 (_S)
#define REPEAT9(_S) _S REPEAT8 (_S)
#define REPEAT10(_S) _S REPEAT9 (_S)
#define REPEAT(_N, _S) REPEAT ## _N (_S)
#define LOREM1 \
"Lorem ipsum dolor sit amet, an quidam consetetur vix, vix ut ullum nominat"\
"i assueverit. Impetus nonumes et sed, ut soleat apeirian moderatius cum, c"\
"u essent possim causae mel. Eu alia qualisque sea, id per solum viderer om"\
"nesque, ancillae luptatum sit cu. Vim ad idque euismod nominavi, sit quis "\
" utinam noluisse no, quo et dicunt alterum recteque. Usu case nonumy tacim"\
"ates id, sed ut ullum ponderum definitionem, has ad duis minimum mandamus."\
" Et nec bonorum conceptam, has molestie efficiantur cu.\n" \
"At ignota doctus his. Eu sit ornatus nonumes phaedrum. Ei mel impedit dese"\
"runt mnesarchum, magna feugiat blandit pro eu. Dicant discere molestie vim"\
" te, vim omnesque legendos vulputate ei, agam nonumes reprehendunt ut sea."\
" Graece audire ut qui. Numquam ponderum quo et, purto graeci fuisset ne ne"\
"c, quo labores dissentiet an. Wisi insolens assentior at usu, eos no muner"\
"e inimicus voluptaria, ne sea alia feugait sententiae.\n" \
"Mei ex graecis assueverit. Id erat similique nec idque euismod appareat " \
"has ad. Odio noster ullum.\n"
#define LOREM10 REPEAT (10, LOREM1)
#define LOREM100 REPEAT (10, LOREM10)
#define LOREM1000 REPEAT (10, LOREM100)
#define FILL(_N) REPEAT (_N, "\0")
#define LOREM_NAME(_SIZE, _OFF) lorem ## _SIZE ## _off ## _OFF
#define _LOREM_NAME(_SIZE, _OFF) _lorem ## _SIZE ## _off ## _OFF
#define MK_LOREM(_SIZE, _OFF) \
char _LOREM_NAME (_SIZE, _OFF) [] = FILL (_OFF) LOREM ## _SIZE; \
char * LOREM_NAME (_SIZE, _OFF) = _LOREM_NAME (_SIZE, _OFF) + _OFF
#define MK_LOREM_SET(_SIZE) \
MK_LOREM (_SIZE, 0); \
char * lorem ## _SIZE = _LOREM_NAME (_SIZE, 0); \
MK_LOREM (_SIZE, 1); \
MK_LOREM (_SIZE, 2); \
MK_LOREM (_SIZE, 3); \
MK_LOREM (_SIZE, 4); \
MK_LOREM (_SIZE, 5); \
MK_LOREM (_SIZE, 6); \
MK_LOREM (_SIZE, 7);
MK_LOREM_SET (10);
MK_LOREM_SET (100);
MK_LOREM_SET (1000);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment