From: Fletcher T. Penney Date: Mon, 7 Jan 2019 23:30:45 +0000 (-0500) Subject: UPDATED: Update astyle X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=711cfd1ded681c700775d67d03297e4c2acb123e;p=multimarkdown UPDATED: Update astyle --- diff --git a/.astylerc b/.astylerc index 4db6063..a234a42 100644 --- a/.astylerc +++ b/.astylerc @@ -21,7 +21,7 @@ # Indent pre-processor directives --indent-preproc-block --indent-preproc-define -#--indent-preproc-cond +# --indent-preproc-cond # Line endings @@ -42,9 +42,14 @@ # Pointers/References +--align-pointer=middle --align-reference=name +# Line endings +--lineend=linux + + # Excludes --exclude="Sources/libMultiMarkdown/scanners.c" --exclude="Sources/libMultiMarkdown/parser.c" diff --git a/Sources/libMultiMarkdown/aho-corasick.c b/Sources/libMultiMarkdown/aho-corasick.c index 90cd8bc..772776b 100644 --- a/Sources/libMultiMarkdown/aho-corasick.c +++ b/Sources/libMultiMarkdown/aho-corasick.c @@ -157,7 +157,7 @@ bool trie_insert(trie * a, const char * key, unsigned short match_type) { #ifdef TEST -void Test_trie_insert(CuTest* tc) { +void Test_trie_insert(CuTest * tc) { trie * a = trie_new(0); CuAssertIntEquals(tc, kTrieStartingSize, a->capacity); @@ -227,7 +227,7 @@ unsigned short trie_search_match_type(trie * a, const char * query) { #ifdef TEST -void Test_trie_search(CuTest* tc) { +void Test_trie_search(CuTest * tc) { trie * a = trie_new(0); trie_insert(a, "foo", 42); @@ -309,7 +309,7 @@ void ac_trie_prepare(trie * a) { #ifdef TEST -void Test_trie_prepare(CuTest* tc) { +void Test_trie_prepare(CuTest * tc) { trie * a = trie_new(0); trie_insert(a, "a", 1); @@ -519,7 +519,7 @@ match * ac_trie_leftmost_longest_search(trie * a, const char * source, size_t st #ifdef TEST -void Test_aho_trie_search(CuTest* tc) { +void Test_aho_trie_search(CuTest * tc) { trie * a = trie_new(0); trie_insert(a, "foo", 42); diff --git a/Sources/libMultiMarkdown/aho-corasick.h b/Sources/libMultiMarkdown/aho-corasick.h index fec780d..d41d0c8 100644 --- a/Sources/libMultiMarkdown/aho-corasick.h +++ b/Sources/libMultiMarkdown/aho-corasick.h @@ -73,7 +73,7 @@ struct trie { size_t size; // How many nodes are in use? size_t capacity; // How many nodes can we hold - trie_node * node; // Pointer to stack of nodes + trie_node * node; // Pointer to stack of nodes }; typedef struct trie trie; @@ -83,8 +83,8 @@ struct match { size_t start; // Starting offset for this match size_t len; // Length for this match unsigned short match_type; // Match type - struct match * next; // Pointer to next match in list - struct match * prev; // Pointer to previous match in list + struct match * next; // Pointer to next match in list + struct match * prev; // Pointer to previous match in list }; typedef struct match match; diff --git a/Sources/libMultiMarkdown/char.c b/Sources/libMultiMarkdown/char.c index 902768a..286cf6f 100644 --- a/Sources/libMultiMarkdown/char.c +++ b/Sources/libMultiMarkdown/char.c @@ -111,7 +111,7 @@ int char_is_windows_line_ending(char * c) { } #ifdef TEST -void Test_char_is_windows_line_ending(CuTest* tc) { +void Test_char_is_windows_line_ending(CuTest * tc) { char * test = "\r\n\n"; CuAssertIntEquals(tc, 1, char_is_windows_line_ending(&test[0])); diff --git a/Sources/libMultiMarkdown/char_lookup.c b/Sources/libMultiMarkdown/char_lookup.c index dc96044..9529544 100644 --- a/Sources/libMultiMarkdown/char_lookup.c +++ b/Sources/libMultiMarkdown/char_lookup.c @@ -67,7 +67,7 @@ #define USE_EXTENDED_ASCII_disabled 1 -int main( int argc, char** argv ) { +int main( int argc, char ** argv ) { unsigned char table[256] = {0}; // Define punctuation diff --git a/Sources/libMultiMarkdown/critic_markup.c b/Sources/libMultiMarkdown/critic_markup.c index 3f14be1..162aa12 100644 --- a/Sources/libMultiMarkdown/critic_markup.c +++ b/Sources/libMultiMarkdown/critic_markup.c @@ -346,7 +346,7 @@ void mmd_critic_markup_reject(DString * d) { #ifdef TEST -void Test_critic(CuTest* tc) { +void Test_critic(CuTest * tc) { #ifdef kUseObjectPool token_pool_init(); #endif diff --git a/Sources/libMultiMarkdown/d_string.c b/Sources/libMultiMarkdown/d_string.c index efbcc95..941be7f 100644 --- a/Sources/libMultiMarkdown/d_string.c +++ b/Sources/libMultiMarkdown/d_string.c @@ -85,12 +85,12 @@ // Some operating systems do not supply vasprintf() -- standardize on this // replacement from: // https://github.com/esp8266/Arduino/issues/1954 -int vasprintf(char** strp, const char* fmt, va_list ap) { +int vasprintf(char ** strp, const char * fmt, va_list ap) { va_list ap2; va_copy(ap2, ap); #if (defined(_WIN32) || defined(__WIN32__)) - char *tmp = NULL; + char * tmp = NULL; int size = vsnprintf(tmp, 0, fmt, ap2); #else char tmp[1]; @@ -103,7 +103,7 @@ int vasprintf(char** strp, const char* fmt, va_list ap) { va_end(ap2); size += 1; - *strp = (char*)malloc(size * sizeof(char)); + *strp = (char *)malloc(size * sizeof(char)); return vsnprintf(*strp, size, fmt, ap); } @@ -116,8 +116,8 @@ int vasprintf(char** strp, const char* fmt, va_list ap) { /// Create a new dynamic string -DString* d_string_new(const char * startingString) { - DString* newString = malloc(sizeof(DString)); +DString * d_string_new(const char * startingString) { + DString * newString = malloc(sizeof(DString)); if (!newString) { return NULL; @@ -151,7 +151,7 @@ DString* d_string_new(const char * startingString) { #ifdef TEST -void Test_d_string_new(CuTest* tc) { +void Test_d_string_new(CuTest * tc) { char * test = "foo"; DString * result = d_string_new(test); @@ -176,12 +176,12 @@ void Test_d_string_new(CuTest* tc) { /// Free dynamic string -char* d_string_free(DString * ripString, bool freeCharacterData) { +char * d_string_free(DString * ripString, bool freeCharacterData) { if (ripString == NULL) { return NULL; } - char* returnedString = ripString->str; + char * returnedString = ripString->str; if (freeCharacterData) { if (ripString->str != NULL) { @@ -213,7 +213,7 @@ static void ensureStringBufferCanHold(DString * baseString, size_t newStringSize } } - char *temp; + char * temp; temp = realloc(baseString->str, newBufferSize); if (temp == NULL) { @@ -231,7 +231,7 @@ static void ensureStringBufferCanHold(DString * baseString, size_t newStringSize #ifdef TEST -void Test_ensureStringBufferCanHold(CuTest* tc) { +void Test_ensureStringBufferCanHold(CuTest * tc) { char * test = "foo"; DString * result = d_string_new(test); @@ -277,7 +277,7 @@ void d_string_append(DString * baseString, const char * appendedString) { #ifdef TEST -void Test_d_string_append(CuTest* tc) { +void Test_d_string_append(CuTest * tc) { char * test = "foo"; DString * result = d_string_new(test); @@ -312,7 +312,7 @@ void d_string_append_c(DString * baseString, char appendedCharacter) { #ifdef TEST -void Test_d_string_append_c(CuTest* tc) { +void Test_d_string_append_c(CuTest * tc) { char * test = "foo"; DString * result = d_string_new(test); @@ -343,7 +343,7 @@ void d_string_append_c_array(DString * baseString, const char * appendedChars, s size_t newSizeNeeded = baseString->currentStringLength + bytes; ensureStringBufferCanHold(baseString, newSizeNeeded); - memcpy((void*)baseString->str + baseString->currentStringLength, appendedChars, bytes); + memcpy((void *)baseString->str + baseString->currentStringLength, appendedChars, bytes); baseString->currentStringLength = newSizeNeeded; baseString->str[newSizeNeeded] = '\0'; @@ -354,7 +354,7 @@ void d_string_append_c_array(DString * baseString, const char * appendedChars, s #ifdef TEST -void Test_d_string_append_c_array(CuTest* tc) { +void Test_d_string_append_c_array(CuTest * tc) { char * test = "foo"; DString * result = d_string_new(test); @@ -388,7 +388,7 @@ void d_string_append_printf(DString * baseString, const char * format, ...) { va_list args; va_start(args, format); - char* formattedString = NULL; + char * formattedString = NULL; vasprintf(&formattedString, format, args); if (formattedString != NULL) { @@ -402,7 +402,7 @@ void d_string_append_printf(DString * baseString, const char * format, ...) { #ifdef TEST -void Test_d_string_append_printf(CuTest* tc) { +void Test_d_string_append_printf(CuTest * tc) { char * test = "foo"; DString * result = d_string_new(test); @@ -445,7 +445,7 @@ void d_string_prepend(DString * baseString, const char * prependedString) { #ifdef TEST -void Test_d_string_prepend(CuTest* tc) { +void Test_d_string_prepend(CuTest * tc) { char * test = "foo"; DString * result = d_string_new(test); @@ -489,7 +489,7 @@ void d_string_insert(DString * baseString, size_t pos, const char * insertedStri #ifdef TEST -void Test_d_string_insert(CuTest* tc) { +void Test_d_string_insert(CuTest * tc) { char * test = "foo"; DString * result = d_string_new(test); @@ -534,7 +534,7 @@ void d_string_insert_c(DString * baseString, size_t pos, char insertedCharacter) #ifdef TEST -void Test_d_string_insert_c(CuTest* tc) { +void Test_d_string_insert_c(CuTest * tc) { char * test = "foo"; DString * result = d_string_new(test); @@ -583,7 +583,7 @@ void d_string_insert_c_array(DString * baseString, size_t pos, const char * inse #ifdef TEST -void Test_d_string_insert_c_array(CuTest* tc) { +void Test_d_string_insert_c_array(CuTest * tc) { char * test = "foo"; DString * result = d_string_new(test); @@ -613,7 +613,7 @@ void d_string_insert_printf(DString * baseString, size_t pos, const char * forma va_list args; va_start(args, format); - char* formattedString = NULL; + char * formattedString = NULL; vasprintf(&formattedString, format, args); if (formattedString != NULL) { @@ -627,7 +627,7 @@ void d_string_insert_printf(DString * baseString, size_t pos, const char * forma #ifdef TEST -void Test_d_string_insert_printf(CuTest* tc) { +void Test_d_string_insert_printf(CuTest * tc) { char * test = "foo"; DString * result = d_string_new(test); @@ -671,7 +671,7 @@ void d_string_erase(DString * baseString, size_t pos, size_t len) { #ifdef TEST -void Test_d_string_erase(CuTest* tc) { +void Test_d_string_erase(CuTest * tc) { char * test = "foobar"; DString * result = d_string_new(test); @@ -727,7 +727,7 @@ char * d_string_copy_substring(DString * d, size_t start, size_t len) { #ifdef TEST -void Test_d_string_copy_substring(CuTest* tc) { +void Test_d_string_copy_substring(CuTest * tc) { char * test = "foobar"; DString * result = d_string_new(test); @@ -803,7 +803,7 @@ long d_string_replace_text_in_range(DString * d, size_t pos, size_t len, const c #ifdef TEST -void Test_d_string_replace_text_in_range(CuTest* tc) { +void Test_d_string_replace_text_in_range(CuTest * tc) { char * test = "foobarfoobarfoo"; long delta = 0; diff --git a/Sources/libMultiMarkdown/file.c b/Sources/libMultiMarkdown/file.c index 59dc736..65de2d1 100644 --- a/Sources/libMultiMarkdown/file.c +++ b/Sources/libMultiMarkdown/file.c @@ -191,7 +191,7 @@ bool is_separator(char c) { #ifdef TEST -void Test_is_separator(CuTest* tc) { +void Test_is_separator(CuTest * tc) { char * test = "a/\\"; #if defined(__WIN32) @@ -301,7 +301,7 @@ char * path_from_dir_base(const char * dir, const char * base) { #ifdef TEST -void Test_path_from_dir_base(CuTest* tc) { +void Test_path_from_dir_base(CuTest * tc) { char dir[10] = "/foo"; char base[10] = "bar"; @@ -359,7 +359,7 @@ void split_path_file(char ** dir, char ** file, const char * path) { #ifdef TEST -void Test_split_path_file(CuTest* tc) { +void Test_split_path_file(CuTest * tc) { char * dir, * file; char * path = "/foo/bar.txt"; @@ -388,15 +388,15 @@ void Test_split_path_file(CuTest* tc) { // Let compiler know where to find GetFullPathName() #include -char *realpath(const char *path, char *resolved_path) { +char * realpath(const char * path, char * resolved_path) { DWORD retval = 0; DWORD dwBufSize = 0; // Just in case MAX_PATH differs from PATH_MAX - TCHAR *buffer = NULL; + TCHAR * buffer = NULL; if (resolved_path == NULL) { // realpath allocates appropiate bytes if resolved_path is null. This is to mimic realpath behavior dwBufSize = PATH_MAX; // Use windows PATH_MAX constant, because we are in Windows context now. - buffer = (char*)malloc(dwBufSize); + buffer = (char *)malloc(dwBufSize); if (buffer == NULL) { return NULL; // some really weird is going on... diff --git a/Sources/libMultiMarkdown/file.h b/Sources/libMultiMarkdown/file.h index 1cc351e..2fdff1d 100644 --- a/Sources/libMultiMarkdown/file.h +++ b/Sources/libMultiMarkdown/file.h @@ -147,7 +147,7 @@ char * absolute_path_for_argument(const char * arg); #if (defined(_WIN32) || defined(__WIN32__)) // Windows does not know realpath(), so we need a "windows port" - char *realpath(const char *path, char *resolved_path); + char * realpath(const char * path, char * resolved_path); #endif #endif diff --git a/Sources/libMultiMarkdown/html.c b/Sources/libMultiMarkdown/html.c index 8f9359c..1bc97e1 100644 --- a/Sources/libMultiMarkdown/html.c +++ b/Sources/libMultiMarkdown/html.c @@ -259,8 +259,8 @@ void mmd_print_localized_char_html(DString * out, unsigned short type, scratch_p } -static char * strip_dimension_units(char *original) { - char *result; +static char * strip_dimension_units(char * original) { + char * result; int i; result = my_strdup(original); diff --git a/Sources/libMultiMarkdown/include/libMultiMarkdown.h b/Sources/libMultiMarkdown/include/libMultiMarkdown.h index 3e63c9a..44f9f30 100644 --- a/Sources/libMultiMarkdown/include/libMultiMarkdown.h +++ b/Sources/libMultiMarkdown/include/libMultiMarkdown.h @@ -211,7 +211,7 @@ struct stack * mmd_d_string_transclusion_manifest(DString * source, const char * /// Create MMD Engine using an existing DString (A new copy is *not* made) mmd_engine * mmd_engine_create_with_dstring( - DString * d, + DString * d, unsigned long extensions ); @@ -262,11 +262,11 @@ void mmd_engine_convert_to_file(mmd_engine * e, short format, const char * direc /// Convert OPML to text without modifying original engine source -DString * mmd_engine_convert_opml_to_text(mmd_engine * e); +DString * mmd_engine_convert_opml_to_text(mmd_engine * e); /// Convert ITMZ to text without modifying original engine source -DString * mmd_engine_convert_itmz_to_text(mmd_engine * e); +DString * mmd_engine_convert_itmz_to_text(mmd_engine * e); /// Convert MMD text to specified format using DString as a container for block of data diff --git a/Sources/libMultiMarkdown/include/token.h b/Sources/libMultiMarkdown/include/token.h index e8a80c0..d1859c7 100644 --- a/Sources/libMultiMarkdown/include/token.h +++ b/Sources/libMultiMarkdown/include/token.h @@ -85,13 +85,13 @@ struct token { size_t start; //!< Starting offset in the source string size_t len; //!< Length of the token in the source string - struct token * next; //!< Pointer to next token in the chain - struct token * prev; //!< Pointer to previous marker in the chain - struct token * child; //!< Pointer to child chain + struct token * next; //!< Pointer to next token in the chain + struct token * prev; //!< Pointer to previous marker in the chain + struct token * child; //!< Pointer to child chain - struct token * tail; //!< Pointer to last token in the chain + struct token * tail; //!< Pointer to last token in the chain - struct token * mate; //!< Pointer to other token in matched pair + struct token * mate; //!< Pointer to other token in matched pair }; typedef struct token token; diff --git a/Sources/libMultiMarkdown/itmz-parser.c b/Sources/libMultiMarkdown/itmz-parser.c index 8533b4f..c766134 100644 --- a/Sources/libMultiMarkdown/itmz-parser.c +++ b/Sources/libMultiMarkdown/itmz-parser.c @@ -274,7 +274,7 @@ typedef struct yyStackEntry yyStackEntry; /* The state of the parser is completely contained in an instance of ** the following structure */ struct yyParser { - yyStackEntry *yytos; /* Pointer to top element of the stack */ + yyStackEntry * yytos; /* Pointer to top element of the stack */ #ifdef YYTRACKMAXSTACKDEPTH int yyhwm; /* High-water mark of the stack */ #endif @@ -284,7 +284,7 @@ struct yyParser { ITMZARG_SDECL /* A place to hold %extra_argument */ #if YYSTACKDEPTH<=0 int yystksz; /* Current side of the stack */ - yyStackEntry *yystack; /* The parser's stack */ + yyStackEntry * yystack; /* The parser's stack */ yyStackEntry yystk0; /* First stack entry */ #else yyStackEntry yystack[YYSTACKDEPTH]; /* The parser's stack */ @@ -294,8 +294,8 @@ typedef struct yyParser yyParser; #ifndef NDEBUG #include - static FILE *yyTraceFILE = 0; - static char *yyTracePrompt = 0; + static FILE * yyTraceFILE = 0; + static char * yyTracePrompt = 0; #endif /* NDEBUG */ #ifndef NDEBUG @@ -316,7 +316,7 @@ typedef struct yyParser yyParser; ** Outputs: ** None. */ -void ITMZTrace(FILE *TraceFILE, char *zTracePrompt) { +void ITMZTrace(FILE * TraceFILE, char * zTracePrompt) { yyTraceFILE = TraceFILE; yyTracePrompt = zTracePrompt; @@ -331,7 +331,7 @@ void ITMZTrace(FILE *TraceFILE, char *zTracePrompt) { #ifndef NDEBUG /* For tracing shifts, the names of all terminals and nonterminals ** are required. The following table supplies these names */ -static const char *const yyTokenName[] = { +static const char * const yyTokenName[] = { "$", "ITMZ_ITHOUGHTS_OPEN", "ITMZ_ITHOUGHTS_CLOSE", "ITMZ_TOPICS_OPEN", "ITMZ_TOPICS_CLOSE", "ITMZ_TOPIC_OPEN", "ITMZ_TOPIC_CLOSE", "ITMZ_TOPIC_PREAMBLE", "ITMZ_TOPIC_METADATA", "ITMZ_TOPIC_SELF_CLOSE", "ITMZ_RELATIONSHIPS_OPEN", "ITMZ_RELATIONSHIPS_CLOSE", @@ -343,7 +343,7 @@ static const char *const yyTokenName[] = { #ifndef NDEBUG /* For tracing reduce actions, the names of all rules are required. */ -static const char *const yyRuleName[] = { +static const char * const yyRuleName[] = { /* 0 */ "doc ::= doc_ithoughts", /* 1 */ "doc_ithoughts ::= ITMZ_ITHOUGHTS_OPEN itmz_topics_section itmz_relationships ITMZ_ITHOUGHTS_CLOSE", /* 2 */ "doc_ithoughts ::= ITMZ_ITHOUGHTS_OPEN itmz_relationships ITMZ_ITHOUGHTS_CLOSE", @@ -369,10 +369,10 @@ static const char *const yyRuleName[] = { ** Try to increase the size of the parser stack. Return the number ** of errors. Return 0 on success. */ -static int yyGrowStack(yyParser *p) { +static int yyGrowStack(yyParser * p) { int newSize; int idx; - yyStackEntry *pNew; + yyStackEntry * pNew; newSize = p->yystksz * 2 + 100; idx = p->yytos ? (int)(p->yytos - p->yystack) : 0; @@ -426,9 +426,9 @@ static int yyGrowStack(yyParser *p) { ** A pointer to a parser. This pointer is used in subsequent calls ** to ITMZ and ITMZFree. */ -void *ITMZAlloc(void *(*mallocProc)(YYMALLOCARGTYPE)) { - yyParser *pParser; - pParser = (yyParser*)(*mallocProc)( (YYMALLOCARGTYPE)sizeof(yyParser) ); +void * ITMZAlloc(void * (*mallocProc)(YYMALLOCARGTYPE)) { + yyParser * pParser; + pParser = (yyParser *)(*mallocProc)( (YYMALLOCARGTYPE)sizeof(yyParser) ); if ( pParser ) { #ifdef YYTRACKMAXSTACKDEPTH @@ -464,9 +464,9 @@ void *ITMZAlloc(void *(*mallocProc)(YYMALLOCARGTYPE)) { ** directives of the input grammar. */ static void yy_destructor( - yyParser *yypParser, /* The parser */ + yyParser * yypParser, /* The parser */ YYCODETYPE yymajor, /* Type code for object to destroy */ - YYMINORTYPE *yypminor /* The object to be destroyed */ + YYMINORTYPE * yypminor /* The object to be destroyed */ ) { ITMZARG_FETCH; @@ -494,8 +494,8 @@ static void yy_destructor( ** If there is a destructor routine associated with the token which ** is popped from the stack, then call it. */ -static void yy_pop_parser_stack(yyParser *pParser) { - yyStackEntry *yytos; +static void yy_pop_parser_stack(yyParser * pParser) { + yyStackEntry * yytos; assert( pParser->yytos != 0 ); assert( pParser->yytos > pParser->yystack ); yytos = pParser->yytos--; @@ -520,10 +520,10 @@ static void yy_pop_parser_stack(yyParser *pParser) { ** assumed that the input pointer is never NULL. */ void ITMZFree( - void *p, /* The parser to be deleted */ - void (*freeProc)(void*) /* Function used to reclaim memory */ + void * p, /* The parser to be deleted */ + void (*freeProc)(void *) /* Function used to reclaim memory */ ) { - yyParser *pParser = (yyParser*)p; + yyParser * pParser = (yyParser *)p; #ifndef YYPARSEFREENEVERNULL if ( pParser == 0 ) { @@ -543,15 +543,15 @@ void ITMZFree( } #endif - (*freeProc)((void*)pParser); + (*freeProc)((void *)pParser); } /* ** Return the peak depth of the stack for a parser. */ #ifdef YYTRACKMAXSTACKDEPTH -int ITMZStackPeak(void *p) { - yyParser *pParser = (yyParser*)p; +int ITMZStackPeak(void * p) { + yyParser * pParser = (yyParser *)p; return pParser->yyhwm; } #endif @@ -561,7 +561,7 @@ int ITMZStackPeak(void *p) { ** look-ahead token iLookAhead. */ static unsigned int yy_find_shift_action( - yyParser *pParser, /* The parser */ + yyParser * pParser, /* The parser */ YYCODETYPE iLookAhead /* The look-ahead token */ ) { int i; @@ -669,7 +669,7 @@ static int yy_find_reduce_action( /* ** The following routine is called if the stack overflows. */ -static void yyStackOverflow(yyParser *yypParser) { +static void yyStackOverflow(yyParser * yypParser) { ITMZARG_FETCH; yypParser->yytos--; #ifndef NDEBUG @@ -695,7 +695,7 @@ static void yyStackOverflow(yyParser *yypParser) { ** Print tracing information for a SHIFT action */ #ifndef NDEBUG -static void yyTraceShift(yyParser *yypParser, int yyNewState) { +static void yyTraceShift(yyParser * yypParser, int yyNewState) { if ( yyTraceFILE ) { if ( yyNewState < YYNSTATE ) { fprintf(yyTraceFILE, "%sShift '%s', go to state %d\n", @@ -715,12 +715,12 @@ static void yyTraceShift(yyParser *yypParser, int yyNewState) { ** Perform a shift action. */ static void yy_shift( - yyParser *yypParser, /* The parser to be shifted */ + yyParser * yypParser, /* The parser to be shifted */ int yyNewState, /* The new state to shift in */ int yyMajor, /* The major token to shift in */ ITMZTOKENTYPE yyMinor /* The minor token to shift in */ ) { - yyStackEntry *yytos; + yyStackEntry * yytos; yypParser->yytos++; #ifdef YYTRACKMAXSTACKDEPTH @@ -784,19 +784,19 @@ static const struct { { 16, 0 }, }; -static void yy_accept(yyParser*); /* Forward Declaration */ +static void yy_accept(yyParser *); /* Forward Declaration */ /* ** Perform a reduce action and the shift that must immediately ** follow the reduce. */ static void yy_reduce( - yyParser *yypParser, /* The parser */ + yyParser * yypParser, /* The parser */ unsigned int yyruleno /* Number of the rule by which to reduce */ ) { int yygoto; /* The next state */ int yyact; /* The next action */ - yyStackEntry *yymsp; /* The top of the parser's stack */ + yyStackEntry * yymsp; /* The top of the parser's stack */ int yysize; /* Amount to pop the stack */ ITMZARG_FETCH; yymsp = yypParser->yytos; @@ -909,7 +909,7 @@ static void yy_reduce( */ #ifndef YYNOERRORRECOVERY static void yy_parse_failed( - yyParser *yypParser /* The parser */ + yyParser * yypParser /* The parser */ ) { ITMZARG_FETCH; #ifndef NDEBUG @@ -938,7 +938,7 @@ static void yy_parse_failed( ** The following code executes when a syntax error first occurs. */ static void yy_syntax_error( - yyParser *yypParser, /* The parser */ + yyParser * yypParser, /* The parser */ int yymajor, /* The major type of the error token */ ITMZTOKENTYPE yyminor /* The minor type of the error token */ ) { @@ -968,7 +968,7 @@ static void yy_syntax_error( ** The following is executed when the parser accepts */ static void yy_accept( - yyParser *yypParser /* The parser */ + yyParser * yypParser /* The parser */ ) { ITMZARG_FETCH; #ifndef NDEBUG @@ -1011,7 +1011,7 @@ static void yy_accept( ** None. */ void ITMZ( - void *yyp, /* The parser */ + void * yyp, /* The parser */ int yymajor, /* The major token code number */ ITMZTOKENTYPE yyminor /* The value for the token */ ITMZARG_PDECL /* Optional %extra_argument parameter */ @@ -1024,9 +1024,9 @@ void ITMZ( #ifdef YYERRORSYMBOL int yyerrorhit = 0; /* True if yymajor has invoked an error */ #endif - yyParser *yypParser; /* The parser */ + yyParser * yypParser; /* The parser */ - yypParser = (yyParser*)yyp; + yypParser = (yyParser *)yyp; assert( yypParser->yytos != 0 ); #if !defined(YYERRORSYMBOL) && !defined(YYNOERRORRECOVERY) yyendofinput = (yymajor == 0); @@ -1172,7 +1172,7 @@ void ITMZ( #ifndef NDEBUG if ( yyTraceFILE ) { - yyStackEntry *i; + yyStackEntry * i; char cDiv = '['; fprintf(yyTraceFILE, "%sReturn. Stack=", yyTracePrompt); diff --git a/Sources/libMultiMarkdown/itmz-reader.c b/Sources/libMultiMarkdown/itmz-reader.c index 8ac08d6..b3160ad 100644 --- a/Sources/libMultiMarkdown/itmz-reader.c +++ b/Sources/libMultiMarkdown/itmz-reader.c @@ -117,7 +117,7 @@ void * ITMZAlloc(void *); void ITMZ(void *, int, void *, void *); void ITMZFree(void *, void *); -void ITMZTrace(FILE *stream, char *zPrefix); +void ITMZTrace(FILE * stream, char * zPrefix); #define print(x) d_string_append(out, x) @@ -192,7 +192,7 @@ token * tokenize_itmz_string(mmd_engine * e, size_t start, size_t len) { void parse_itmz_token_chain(mmd_engine * e, token * chain) { - void* pParser = ITMZAlloc (malloc); // Create a parser (for lemon) + void * pParser = ITMZAlloc (malloc); // Create a parser (for lemon) token * walker = chain->next; // Walk the existing tree token * remainder; // Hold unparsed tail of chain diff --git a/Sources/libMultiMarkdown/latex.c b/Sources/libMultiMarkdown/latex.c index 7dc213e..936b79f 100644 --- a/Sources/libMultiMarkdown/latex.c +++ b/Sources/libMultiMarkdown/latex.c @@ -310,8 +310,8 @@ void mmd_export_link_latex(DString * out, const char * source, token * text, lin } -static char * correct_dimension_units(char *original) { - char *result; +static char * correct_dimension_units(char * original) { + char * result; int i; result = my_strdup(original); diff --git a/Sources/libMultiMarkdown/mmd.c b/Sources/libMultiMarkdown/mmd.c index 6c39c6b..0f4c63f 100644 --- a/Sources/libMultiMarkdown/mmd.c +++ b/Sources/libMultiMarkdown/mmd.c @@ -82,7 +82,7 @@ void * ParseAlloc(void *); void Parse(void *, int, void *, void *); void ParseFree(void *, void *); -void ParseTrace(FILE *stream, char *zPrefix); +void ParseTrace(FILE * stream, char * zPrefix); void mmd_pair_tokens_in_block(token * block, token_pair_engine * e, stack * s); @@ -1137,7 +1137,7 @@ void mmd_parse_token_chain(mmd_engine * e, token * chain) { e->recurse_depth++; - void* pParser = ParseAlloc (malloc); // Create a parser (for lemon) + void * pParser = ParseAlloc (malloc); // Create a parser (for lemon) token * walker = chain->child; // Walk the existing tree token * remainder; // Hold unparsed tail of chain @@ -2883,7 +2883,7 @@ DString * mmd_d_string_convert_opml_to_text(DString * source) { /// Convert OPML to text without modifying original engine source -DString * mmd_engine_convert_opml_to_text(mmd_engine * e) { +DString * mmd_engine_convert_opml_to_text(mmd_engine * e) { DString * original = d_string_new(""); d_string_append_c_array(original, e->dstr->str, e->dstr->currentStringLength); @@ -2932,7 +2932,7 @@ DString * mmd_d_string_convert_itmz_to_text(DString * source) { /// Convert ITMZ to text without modifying original engine source -DString * mmd_engine_convert_itmz_to_text(mmd_engine * e) { +DString * mmd_engine_convert_itmz_to_text(mmd_engine * e) { DString * original = d_string_new(""); d_string_append_c_array(original, e->dstr->str, e->dstr->currentStringLength); diff --git a/Sources/libMultiMarkdown/mmd.h b/Sources/libMultiMarkdown/mmd.h index 2f3622a..026b17f 100644 --- a/Sources/libMultiMarkdown/mmd.h +++ b/Sources/libMultiMarkdown/mmd.h @@ -68,32 +68,32 @@ struct mmd_engine { - DString * dstr; - token * root; + DString * dstr; + token * root; unsigned long extensions; unsigned short recurse_depth; bool allow_meta; - token_pair_engine * pairings1; - token_pair_engine * pairings2; - token_pair_engine * pairings3; - token_pair_engine * pairings4; - - stack * abbreviation_stack; - stack * citation_stack; - stack * definition_stack; - stack * footnote_stack; - stack * glossary_stack; - stack * header_stack; - stack * link_stack; - stack * metadata_stack; - stack * table_stack; + token_pair_engine * pairings1; + token_pair_engine * pairings2; + token_pair_engine * pairings3; + token_pair_engine * pairings4; + + stack * abbreviation_stack; + stack * citation_stack; + stack * definition_stack; + stack * footnote_stack; + stack * glossary_stack; + stack * header_stack; + stack * link_stack; + stack * metadata_stack; + stack * table_stack; short language; short quotes_lang; - struct asset * asset_hash; + struct asset * asset_hash; int random_seed_base_labels; }; @@ -111,8 +111,8 @@ void is_list_loose(token * list); struct asset { - char * url; - char * asset_path; + char * url; + char * asset_path; UT_hash_handle hh; }; diff --git a/Sources/libMultiMarkdown/object_pool.h b/Sources/libMultiMarkdown/object_pool.h index ba0c133..3716940 100644 --- a/Sources/libMultiMarkdown/object_pool.h +++ b/Sources/libMultiMarkdown/object_pool.h @@ -63,9 +63,9 @@ /// Structure for an object allocator pool struct pool { - stack * allocated; //!< Stack of pointers to slabs that have been allocated - void * next; //!< Pointer to next available memory for allocation - void * last; //!< Pointer to end of available memory + stack * allocated; //!< Stack of pointers to slabs that have been allocated + void * next; //!< Pointer to next available memory for allocation + void * last; //!< Pointer to end of available memory short object_size; //!< Size of individual objects to be allocated char _PADDING[6]; //!< pad struct for alignment diff --git a/Sources/libMultiMarkdown/opendocument-content.c b/Sources/libMultiMarkdown/opendocument-content.c index 4110849..ba0dd68 100644 --- a/Sources/libMultiMarkdown/opendocument-content.c +++ b/Sources/libMultiMarkdown/opendocument-content.c @@ -546,8 +546,8 @@ void mmd_export_link_opendocument(DString * out, const char * source, token * te } -static char * correct_dimension_units(char *original) { - char *result; +static char * correct_dimension_units(char * original) { + char * result; int i; result = my_strdup(original); diff --git a/Sources/libMultiMarkdown/opml-parser.c b/Sources/libMultiMarkdown/opml-parser.c index 410b6d1..88bc735 100644 --- a/Sources/libMultiMarkdown/opml-parser.c +++ b/Sources/libMultiMarkdown/opml-parser.c @@ -273,7 +273,7 @@ typedef struct yyStackEntry yyStackEntry; /* The state of the parser is completely contained in an instance of ** the following structure */ struct yyParser { - yyStackEntry *yytos; /* Pointer to top element of the stack */ + yyStackEntry * yytos; /* Pointer to top element of the stack */ #ifdef YYTRACKMAXSTACKDEPTH int yyhwm; /* High-water mark of the stack */ #endif @@ -283,7 +283,7 @@ struct yyParser { OPMLARG_SDECL /* A place to hold %extra_argument */ #if YYSTACKDEPTH<=0 int yystksz; /* Current side of the stack */ - yyStackEntry *yystack; /* The parser's stack */ + yyStackEntry * yystack; /* The parser's stack */ yyStackEntry yystk0; /* First stack entry */ #else yyStackEntry yystack[YYSTACKDEPTH]; /* The parser's stack */ @@ -293,8 +293,8 @@ typedef struct yyParser yyParser; #ifndef NDEBUG #include - static FILE *yyTraceFILE = 0; - static char *yyTracePrompt = 0; + static FILE * yyTraceFILE = 0; + static char * yyTracePrompt = 0; #endif /* NDEBUG */ #ifndef NDEBUG @@ -315,7 +315,7 @@ typedef struct yyParser yyParser; ** Outputs: ** None. */ -void OPMLTrace(FILE *TraceFILE, char *zTracePrompt) { +void OPMLTrace(FILE * TraceFILE, char * zTracePrompt) { yyTraceFILE = TraceFILE; yyTracePrompt = zTracePrompt; @@ -330,7 +330,7 @@ void OPMLTrace(FILE *TraceFILE, char *zTracePrompt) { #ifndef NDEBUG /* For tracing shifts, the names of all terminals and nonterminals ** are required. The following table supplies these names */ -static const char *const yyTokenName[] = { +static const char * const yyTokenName[] = { "$", "OPML_XML", "OPML_WSNL", "OPML_OPML_OPEN", "OPML_OPML_CLOSE", "OPML_HEAD_OPEN", "OPML_HEAD_CLOSE", "OPML_TITLE_OPEN", "OPML_TITLE_CLOSE", "OPML_BODY_OPEN", "OPML_BODY_CLOSE", "OPML_OUTLINE_OPEN", @@ -344,7 +344,7 @@ static const char *const yyTokenName[] = { #ifndef NDEBUG /* For tracing reduce actions, the names of all rules are required. */ -static const char *const yyRuleName[] = { +static const char * const yyRuleName[] = { /* 0 */ "doc ::= doc_xml", /* 1 */ "doc_xml ::= OPML_XML doc_opml", /* 2 */ "doc_xml ::= doc_opml", @@ -373,10 +373,10 @@ static const char *const yyRuleName[] = { ** Try to increase the size of the parser stack. Return the number ** of errors. Return 0 on success. */ -static int yyGrowStack(yyParser *p) { +static int yyGrowStack(yyParser * p) { int newSize; int idx; - yyStackEntry *pNew; + yyStackEntry * pNew; newSize = p->yystksz * 2 + 100; idx = p->yytos ? (int)(p->yytos - p->yystack) : 0; @@ -430,9 +430,9 @@ static int yyGrowStack(yyParser *p) { ** A pointer to a parser. This pointer is used in subsequent calls ** to OPML and OPMLFree. */ -void *OPMLAlloc(void *(*mallocProc)(YYMALLOCARGTYPE)) { - yyParser *pParser; - pParser = (yyParser*)(*mallocProc)( (YYMALLOCARGTYPE)sizeof(yyParser) ); +void * OPMLAlloc(void * (*mallocProc)(YYMALLOCARGTYPE)) { + yyParser * pParser; + pParser = (yyParser *)(*mallocProc)( (YYMALLOCARGTYPE)sizeof(yyParser) ); if ( pParser ) { #ifdef YYTRACKMAXSTACKDEPTH @@ -468,9 +468,9 @@ void *OPMLAlloc(void *(*mallocProc)(YYMALLOCARGTYPE)) { ** directives of the input grammar. */ static void yy_destructor( - yyParser *yypParser, /* The parser */ + yyParser * yypParser, /* The parser */ YYCODETYPE yymajor, /* Type code for object to destroy */ - YYMINORTYPE *yypminor /* The object to be destroyed */ + YYMINORTYPE * yypminor /* The object to be destroyed */ ) { OPMLARG_FETCH; @@ -498,8 +498,8 @@ static void yy_destructor( ** If there is a destructor routine associated with the token which ** is popped from the stack, then call it. */ -static void yy_pop_parser_stack(yyParser *pParser) { - yyStackEntry *yytos; +static void yy_pop_parser_stack(yyParser * pParser) { + yyStackEntry * yytos; assert( pParser->yytos != 0 ); assert( pParser->yytos > pParser->yystack ); yytos = pParser->yytos--; @@ -524,10 +524,10 @@ static void yy_pop_parser_stack(yyParser *pParser) { ** assumed that the input pointer is never NULL. */ void OPMLFree( - void *p, /* The parser to be deleted */ - void (*freeProc)(void*) /* Function used to reclaim memory */ + void * p, /* The parser to be deleted */ + void (*freeProc)(void *) /* Function used to reclaim memory */ ) { - yyParser *pParser = (yyParser*)p; + yyParser * pParser = (yyParser *)p; #ifndef YYPARSEFREENEVERNULL if ( pParser == 0 ) { @@ -547,15 +547,15 @@ void OPMLFree( } #endif - (*freeProc)((void*)pParser); + (*freeProc)((void *)pParser); } /* ** Return the peak depth of the stack for a parser. */ #ifdef YYTRACKMAXSTACKDEPTH -int OPMLStackPeak(void *p) { - yyParser *pParser = (yyParser*)p; +int OPMLStackPeak(void * p) { + yyParser * pParser = (yyParser *)p; return pParser->yyhwm; } #endif @@ -565,7 +565,7 @@ int OPMLStackPeak(void *p) { ** look-ahead token iLookAhead. */ static unsigned int yy_find_shift_action( - yyParser *pParser, /* The parser */ + yyParser * pParser, /* The parser */ YYCODETYPE iLookAhead /* The look-ahead token */ ) { int i; @@ -673,7 +673,7 @@ static int yy_find_reduce_action( /* ** The following routine is called if the stack overflows. */ -static void yyStackOverflow(yyParser *yypParser) { +static void yyStackOverflow(yyParser * yypParser) { OPMLARG_FETCH; yypParser->yytos--; #ifndef NDEBUG @@ -699,7 +699,7 @@ static void yyStackOverflow(yyParser *yypParser) { ** Print tracing information for a SHIFT action */ #ifndef NDEBUG -static void yyTraceShift(yyParser *yypParser, int yyNewState) { +static void yyTraceShift(yyParser * yypParser, int yyNewState) { if ( yyTraceFILE ) { if ( yyNewState < YYNSTATE ) { fprintf(yyTraceFILE, "%sShift '%s', go to state %d\n", @@ -719,12 +719,12 @@ static void yyTraceShift(yyParser *yypParser, int yyNewState) { ** Perform a shift action. */ static void yy_shift( - yyParser *yypParser, /* The parser to be shifted */ + yyParser * yypParser, /* The parser to be shifted */ int yyNewState, /* The new state to shift in */ int yyMajor, /* The major token to shift in */ OPMLTOKENTYPE yyMinor /* The minor token to shift in */ ) { - yyStackEntry *yytos; + yyStackEntry * yytos; yypParser->yytos++; #ifdef YYTRACKMAXSTACKDEPTH @@ -791,19 +791,19 @@ static const struct { { 24, 1 }, }; -static void yy_accept(yyParser*); /* Forward Declaration */ +static void yy_accept(yyParser *); /* Forward Declaration */ /* ** Perform a reduce action and the shift that must immediately ** follow the reduce. */ static void yy_reduce( - yyParser *yypParser, /* The parser */ + yyParser * yypParser, /* The parser */ unsigned int yyruleno /* Number of the rule by which to reduce */ ) { int yygoto; /* The next state */ int yyact; /* The next action */ - yyStackEntry *yymsp; /* The top of the parser's stack */ + yyStackEntry * yymsp; /* The top of the parser's stack */ int yysize; /* Amount to pop the stack */ OPMLARG_FETCH; yymsp = yypParser->yytos; @@ -919,7 +919,7 @@ static void yy_reduce( */ #ifndef YYNOERRORRECOVERY static void yy_parse_failed( - yyParser *yypParser /* The parser */ + yyParser * yypParser /* The parser */ ) { OPMLARG_FETCH; #ifndef NDEBUG @@ -948,7 +948,7 @@ static void yy_parse_failed( ** The following code executes when a syntax error first occurs. */ static void yy_syntax_error( - yyParser *yypParser, /* The parser */ + yyParser * yypParser, /* The parser */ int yymajor, /* The major type of the error token */ OPMLTOKENTYPE yyminor /* The minor type of the error token */ ) { @@ -978,7 +978,7 @@ static void yy_syntax_error( ** The following is executed when the parser accepts */ static void yy_accept( - yyParser *yypParser /* The parser */ + yyParser * yypParser /* The parser */ ) { OPMLARG_FETCH; #ifndef NDEBUG @@ -1021,7 +1021,7 @@ static void yy_accept( ** None. */ void OPML( - void *yyp, /* The parser */ + void * yyp, /* The parser */ int yymajor, /* The major token code number */ OPMLTOKENTYPE yyminor /* The value for the token */ OPMLARG_PDECL /* Optional %extra_argument parameter */ @@ -1034,9 +1034,9 @@ void OPML( #ifdef YYERRORSYMBOL int yyerrorhit = 0; /* True if yymajor has invoked an error */ #endif - yyParser *yypParser; /* The parser */ + yyParser * yypParser; /* The parser */ - yypParser = (yyParser*)yyp; + yypParser = (yyParser *)yyp; assert( yypParser->yytos != 0 ); #if !defined(YYERRORSYMBOL) && !defined(YYNOERRORRECOVERY) yyendofinput = (yymajor == 0); @@ -1182,7 +1182,7 @@ void OPML( #ifndef NDEBUG if ( yyTraceFILE ) { - yyStackEntry *i; + yyStackEntry * i; char cDiv = '['; fprintf(yyTraceFILE, "%sReturn. Stack=", yyTracePrompt); diff --git a/Sources/libMultiMarkdown/opml-reader.c b/Sources/libMultiMarkdown/opml-reader.c index ccc75ac..bfa6d72 100644 --- a/Sources/libMultiMarkdown/opml-reader.c +++ b/Sources/libMultiMarkdown/opml-reader.c @@ -115,7 +115,7 @@ void * OPMLAlloc(void *); void OPML(void *, int, void *, void *); void OPMLFree(void *, void *); -void OPMLTrace(FILE *stream, char *zPrefix); +void OPMLTrace(FILE * stream, char * zPrefix); #define print(x) d_string_append(out, x) @@ -190,7 +190,7 @@ token * tokenize_opml_string(mmd_engine * e, size_t start, size_t len) { void parse_opml_token_chain(mmd_engine * e, token * chain) { - void* pParser = OPMLAlloc (malloc); // Create a parser (for lemon) + void * pParser = OPMLAlloc (malloc); // Create a parser (for lemon) token * walker = chain->next; // Walk the existing tree token * remainder; // Hold unparsed tail of chain diff --git a/Sources/libMultiMarkdown/rng.c b/Sources/libMultiMarkdown/rng.c index 0e208f5..27a9188 100644 --- a/Sources/libMultiMarkdown/rng.c +++ b/Sources/libMultiMarkdown/rng.c @@ -29,7 +29,7 @@ long ran_x[KK]; /* the generator state */ void ran_array(long aa[], int n) #else void ran_array(aa, n) /* put n new random numbers in aa */ - long *aa; /* destination */ + long * aa; /* destination */ int n; /* array length (must be at least KK) */ #endif { @@ -58,7 +58,7 @@ long ran_x[KK]; /* the generator state */ #define QUALITY 1009 /* recommended quality level for high-res use */ long ran_arr_buf[QUALITY]; long ran_arr_dummy = -1, ran_arr_started = -1; -long *ran_arr_ptr = &ran_arr_dummy; /* the next random number, or -1 */ +long * ran_arr_ptr = &ran_arr_dummy; /* the next random number, or -1 */ #define TT 70 /* guaranteed separation between streams */ #define is_odd(x) ((x)&1) /* units bit of x */ diff --git a/Sources/libMultiMarkdown/stack.h b/Sources/libMultiMarkdown/stack.h index 497713f..a8c237d 100644 --- a/Sources/libMultiMarkdown/stack.h +++ b/Sources/libMultiMarkdown/stack.h @@ -62,7 +62,7 @@ struct stack { size_t size; //!< Number of objects currently in stack size_t capacity; //!< Total current capacity for stack - void ** element; //!< Array of pointers to objects in stack + void ** element; //!< Array of pointers to objects in stack }; typedef struct stack stack; diff --git a/Sources/libMultiMarkdown/writer.h b/Sources/libMultiMarkdown/writer.h index 7749564..fbe97c8 100644 --- a/Sources/libMultiMarkdown/writer.h +++ b/Sources/libMultiMarkdown/writer.h @@ -72,8 +72,8 @@ #define kMaxTableColumns 48 //!< Maximum number of table columns for specifying alignment typedef struct { - struct link * link_hash; - struct meta * meta_hash; + struct link * link_hash; + struct meta * meta_hash; unsigned long extensions; short output_format; @@ -83,8 +83,8 @@ typedef struct { short skip_token; short footnote_para_counter; - stack * used_footnotes; - stack * inline_footnotes_to_free; + stack * used_footnotes; + stack * inline_footnotes_to_free; struct fn_holder * footnote_hash; short footnote_being_printed; @@ -93,19 +93,19 @@ typedef struct { int random_seed_base_labels; int label_counter; - stack * used_citations; - stack * inline_citations_to_free; + stack * used_citations; + stack * inline_citations_to_free; struct fn_holder * citation_hash; short citation_being_printed; - char * bibtex_file; + char * bibtex_file; - stack * used_glossaries; - stack * inline_glossaries_to_free; + stack * used_glossaries; + stack * inline_glossaries_to_free; struct fn_holder * glossary_hash; short glossary_being_printed; - stack * used_abbreviations; - stack * inline_abbreviations_to_free; + stack * used_abbreviations; + stack * inline_abbreviations_to_free; struct fn_holder * abbreviation_hash; short language; @@ -113,9 +113,9 @@ typedef struct { short base_header_level; - stack * header_stack; + stack * header_stack; - stack * outline_stack; + stack * outline_stack; short opml_item_closed; short recurse_depth; @@ -127,27 +127,27 @@ typedef struct { short odf_para_type; - struct asset * asset_hash; + struct asset * asset_hash; short store_assets; short remember_assets; } scratch_pad; struct attr { - char * key; - char * value; - struct attr * next; + char * key; + char * value; + struct attr * next; }; typedef struct attr attr; struct link { - token * label; - char * label_text; - char * clean_text; - char * url; - char * title; - attr * attributes; + token * label; + char * label_text; + char * clean_text; + char * url; + char * title; + attr * attributes; short flags; UT_hash_handle hh; }; @@ -162,10 +162,10 @@ enum link_flags { typedef struct link link; struct footnote { - token * label; - char * label_text; - char * clean_text; - token * content; + token * label; + char * label_text; + char * clean_text; + token * content; size_t count; bool free_para; @@ -175,15 +175,15 @@ struct footnote { typedef struct footnote footnote; struct fn_holder { - footnote * note; + footnote * note; UT_hash_handle hh; }; typedef struct fn_holder fn_holder; struct meta { - char * key; - char * value; + char * key; + char * value; size_t start; UT_hash_handle hh; }; @@ -191,9 +191,9 @@ struct meta { typedef struct meta meta; struct abbr { - char * abbr; + char * abbr; size_t abbr_len; - char * expansion; + char * expansion; size_t expansion_len; UT_hash_handle hh; }; diff --git a/Sources/multimarkdown/main.c b/Sources/multimarkdown/main.c index d9c6d76..026dabf 100644 --- a/Sources/multimarkdown/main.c +++ b/Sources/multimarkdown/main.c @@ -74,13 +74,13 @@ #define kBUFFERSIZE 4096 // How many bytes to read at a time // argtable structs -struct arg_lit *a_help, *a_version, *a_compatibility, *a_nolabels, *a_batch, +struct arg_lit * a_help, *a_version, *a_compatibility, *a_nolabels, *a_batch, *a_accept, *a_reject, *a_full, *a_snippet, *a_random, *a_unique, *a_meta, *a_notransclude, *a_nosmart, *a_opml, *a_itmz; -struct arg_str *a_format, *a_lang, *a_extract; -struct arg_file *a_file, *a_o; -struct arg_end *a_end; -struct arg_rem *a_rem1, *a_rem2, *a_rem3, *a_rem4, *a_rem5, *a_rem6; +struct arg_str * a_format, *a_lang, *a_extract; +struct arg_file * a_file, *a_o; +struct arg_end * a_end; +struct arg_rem * a_rem1, *a_rem2, *a_rem3, *a_rem4, *a_rem5, *a_rem6; /// strdup() not available on all platforms @@ -129,14 +129,14 @@ char * filename_with_extension(const char * original, const char * new_extension } -int main(int argc, char** argv) { +int main(int argc, char ** argv) { int exitcode = EXIT_SUCCESS; char * binname = "multimarkdown"; short format = FORMAT_HTML; short language = LC_EN; // Initialize argtable structs - void *argtable[] = { + void * argtable[] = { a_help = arg_lit0(NULL, "help", "display this help and exit"), a_version = arg_lit0(NULL, "version", "display version info and exit"),