From f6e48c3a185df368ab86dbe0655dc7bdd52eb2cc Mon Sep 17 00:00:00 2001 From: Jon Siwek Date: Tue, 1 Sep 2020 11:57:44 -0700 Subject: [PATCH] Reformat strings.bif Zeekygen comments to fix Sphinx warnings --- CHANGES | 4 ++++ VERSION | 2 +- doc | 2 +- src/strings.bif | 61 ++++++++++++++++++++++++++++--------------------- 4 files changed, 41 insertions(+), 28 deletions(-) diff --git a/CHANGES b/CHANGES index 9d7fce9f08..1cc8c2f845 100644 --- a/CHANGES +++ b/CHANGES @@ -1,4 +1,8 @@ +3.3.0-dev.224 | 2020-09-01 11:57:44 -0700 + + * Reformat strings.bif Zeekygen comments to fix Sphinx warnings (Jon Siwek, Corelight) + 3.3.0-dev.221 | 2020-08-31 17:31:21 -0700 * GH-174: Treat ambiguous attribute duplication as an error (Tim Wojtulewicz, Corelight) diff --git a/VERSION b/VERSION index baaa7e85c0..f918cbde66 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -3.3.0-dev.221 +3.3.0-dev.224 diff --git a/doc b/doc index 0ae35c11a6..3b292fa792 160000 --- a/doc +++ b/doc @@ -1 +1 @@ -Subproject commit 0ae35c11a65f961038e7717b0e09529af025017f +Subproject commit 3b292fa792d5a0c8a67d9ecd8ce3f3b14749449f diff --git a/src/strings.bif b/src/strings.bif index 95f29113ad..82da94edf4 100644 --- a/src/strings.bif +++ b/src/strings.bif @@ -1218,35 +1218,38 @@ static int64_t do_find_str(zeek::StringVal* str, zeek::StringVal* sub, int64_t s %%} -## Finds a string within another string, starting from the beginning. This works by taking a substring within -## the provided indexes and searching for the sub argument. This means that ranges shorter than the string in -## the sub argument will always return a failure. +## Finds a string within another string, starting from the beginning. This works +## by taking a substring within the provided indexes and searching for the sub +## argument. This means that ranges shorter than the string in the sub argument +## will always return a failure. ## ## str: The string to search in. ## substr: The string to search for. ## start: An optional position for the start of the substring. -## end: An optional position for the end of the substring. A value less than zero (such as the default -1) -## means a search until the end of the string. -## -## Returns: The position of the substring. Returns -1 if the string wasn't found. Prints an error if the -## starting position is after the ending position. +## end: An optional position for the end of the substring. A value less than +## zero (such as the default -1) means a search until the end of the +## string. ## +## Returns: The position of the substring. Returns -1 if the string wasn't +## found. Prints an error if the starting position is after the ending +## position. function find_str%(str: string, sub: string, start: count &default=0, end: int &default=-1%) : int %{ return zeek::val_mgr->Int(do_find_str(str, sub, start, end, false)); %} -## The same as find(), but returns the highest index matching the substring instead of the smallest. +## The same as find(), but returns the highest index matching the substring +## instead of the smallest. ## ## str: The string to search in. ## substr: The string to search for. ## start: An optional position for the start of the substring. -## end: An optional position for the end of the substring. A value less than zero (such as the default -1) -## means a search from the end of the string. -## -## Returns: The position of the substring. Returns -1 if the string wasn't found. Prints an error if the -## starting position is after the ending position. +## end: An optional position for the end of the substring. A value less than +## zero (such as the default -1) means a search from the end of the string. ## +## Returns: The position of the substring. Returns -1 if the string wasn't +## found. Prints an error if the starting position is after the ending +## position. function rfind_str%(str: string, sub: string, start: count &default=0, end: int &default=-1%) : int %{ return zeek::val_mgr->Int(do_find_str(str, sub, start, end, true)); @@ -1311,15 +1314,18 @@ function is_alnum%(str: string%) : bool return zeek::val_mgr->True(); %} -## Returns a left-justified version of the string, padded to a specific length with a specified character. +## Returns a left-justified version of the string, padded to a specific length +## with a specified character. ## ## str: The string to left-justify. -## count: The length of the returned string. If this value is less than or equal to the length of str, a -## copy of str is returned. -## fill: The character used to fill in any extra characters in the resulting string. If a string longer than -## one character is passed, an error is reported. This defaults to the space character. +## count: The length of the returned string. If this value is less than or +## equal to the length of str, a copy of str is returned. +## fill: The character used to fill in any extra characters in the resulting +## string. If a string longer than one character is passed, an error is +## reported. This defaults to the space character. ## -## Returns: A left-justified version of a string, padded with characters to a specific length. +## Returns: A left-justified version of a string, padded with characters to a +## specific length. ## function ljust%(str: string, width: count, fill: string &default=" "%) : string %{ @@ -1353,15 +1359,18 @@ static zeek::StringValPtr do_rjust(zeek::StringVal* str, uint64_t width, char fi %%} -## Returns a right-justified version of the string, padded to a specific length with a specified character. +## Returns a right-justified version of the string, padded to a specific length +## with a specified character. ## ## str: The string to right-justify. -## count: The length of the returned string. If this value is less than or equal to the length of str, a -## copy of str is returned. -## fill: The character used to fill in any extra characters in the resulting string. If a string longer than -## one character is passed, an error is reported. This defaults to the space character. +## count: The length of the returned string. If this value is less than or +## equal to the length of str, a copy of str is returned. +## fill: The character used to fill in any extra characters in the resulting +## string. If a string longer than one character is passed, an error is +## reported. This defaults to the space character. ## -## Returns: A right-justified version of a string, padded with characters to a specific length. +## Returns: A right-justified version of a string, padded with characters to a +## specific length. ## function rjust%(str: string, width: count, fill: string &default=" "%) : string %{