Unverified Commit 02acb8fd authored by Viktor Söderqvist's avatar Viktor Söderqvist Committed by GitHub
Browse files

Module API docs corrections (#10890)

* Fix typo `RedisModule_CreatString` -> `RedisModule_CreateString` (multiple occurrences)
* Make the markdown gen script change all `RM_` to `RedisModule_` even in code examples, etc.
parent 61baabd8
......@@ -2297,7 +2297,7 @@ RedisModuleString *RM_CreateStringPrintf(RedisModuleCtx *ctx, const char *fmt, .
}
/* Like RedisModule_CreatString(), but creates a string starting from a `long long`
/* Like RedisModule_CreateString(), but creates a string starting from a `long long`
* integer instead of taking a buffer and its length.
*
* The returned string must be released with RedisModule_FreeString() or by
......@@ -2311,7 +2311,7 @@ RedisModuleString *RM_CreateStringFromLongLong(RedisModuleCtx *ctx, long long ll
return RM_CreateString(ctx,buf,len);
}
/* Like RedisModule_CreatString(), but creates a string starting from a double
/* Like RedisModule_CreateString(), but creates a string starting from a double
* instead of taking a buffer and its length.
*
* The returned string must be released with RedisModule_FreeString() or by
......@@ -2322,7 +2322,7 @@ RedisModuleString *RM_CreateStringFromDouble(RedisModuleCtx *ctx, double d) {
return RM_CreateString(ctx,buf,len);
}
/* Like RedisModule_CreatString(), but creates a string starting from a long
/* Like RedisModule_CreateString(), but creates a string starting from a long
* double.
*
* The returned string must be released with RedisModule_FreeString() or by
......@@ -2337,7 +2337,7 @@ RedisModuleString *RM_CreateStringFromLongDouble(RedisModuleCtx *ctx, long doubl
return RM_CreateString(ctx,buf,len);
}
/* Like RedisModule_CreatString(), but creates a string starting from another
/* Like RedisModule_CreateString(), but creates a string starting from another
* RedisModuleString.
*
* The returned string must be released with RedisModule_FreeString() or by
......
......@@ -11,12 +11,13 @@ def markdown(s)
s.chop! while s[-1] == "\n" || s[-1] == " "
lines = s.split("\n")
newlines = []
# Fix some markdown, except in code blocks indented by 4 spaces.
# Fix some markdown
lines.each{|l|
# Rewrite RM_Xyz() to RedisModule_Xyz().
l = l.gsub(/(?<![A-Z_])RM_(?=[A-Z])/, 'RedisModule_')
# Fix more markdown, except in code blocks indented by 4 spaces, which we
# don't want to mess with.
if not l.start_with?(' ')
# Rewrite RM_Xyz() to `RedisModule_Xyz()`. The () suffix is
# optional. Even RM_Xyz*() with * as wildcard is handled.
l = l.gsub(/(?<!`)RM_([A-z]+(?:\*?\(\))?)/, '`RedisModule_\1`')
# Add backquotes around RedisModule functions and type where missing.
l = l.gsub(/(?<!`)RedisModule[A-z]+(?:\*?\(\))?/){|x| "`#{x}`"}
# Add backquotes around c functions like malloc() where missing.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment