Skip to content
Snippets Groups Projects
Commit 0e2806aa authored by Stephan Bosch's avatar Stephan Bosch
Browse files

lib-managesieve: Reformat managesieve-arg.c.

parent a71cf469
No related branches found
No related tags found
No related merge requests found
...@@ -4,8 +4,8 @@ ...@@ -4,8 +4,8 @@
#include "lib.h" #include "lib.h"
#include "managesieve-arg.h" #include "managesieve-arg.h"
bool managesieve_arg_get_atom bool managesieve_arg_get_atom(const struct managesieve_arg *arg,
(const struct managesieve_arg *arg, const char **str_r) const char **str_r)
{ {
if (arg->type != MANAGESIEVE_ARG_ATOM) if (arg->type != MANAGESIEVE_ARG_ATOM)
return FALSE; return FALSE;
...@@ -14,25 +14,25 @@ bool managesieve_arg_get_atom ...@@ -14,25 +14,25 @@ bool managesieve_arg_get_atom
return TRUE; return TRUE;
} }
bool managesieve_arg_get_number bool managesieve_arg_get_number(const struct managesieve_arg *arg,
(const struct managesieve_arg *arg, uoff_t *number_r) uoff_t *number_r)
{ {
const char *data; const char *data;
uoff_t num = 0; uoff_t num = 0;
size_t i; size_t i;
if ( arg->type != MANAGESIEVE_ARG_ATOM ) if (arg->type != MANAGESIEVE_ARG_ATOM)
return FALSE; return FALSE;
data = arg->_data.str; data = arg->_data.str;
for ( i = 0; i < arg->str_len; i++ ) { for (i = 0; i < arg->str_len; i++) {
uoff_t newnum; uoff_t newnum;
if (data[i] < '0' || data[i] > '9') if (data[i] < '0' || data[i] > '9')
return FALSE; return FALSE;
newnum = num*10 + (data[i] -'0'); newnum = num*10 + (data[i] -'0');
if ( newnum < num ) if (newnum < num)
return FALSE; return FALSE;
num = newnum; num = newnum;
...@@ -42,8 +42,8 @@ bool managesieve_arg_get_number ...@@ -42,8 +42,8 @@ bool managesieve_arg_get_number
return TRUE; return TRUE;
} }
bool managesieve_arg_get_quoted bool managesieve_arg_get_quoted(const struct managesieve_arg *arg,
(const struct managesieve_arg *arg, const char **str_r) const char **str_r)
{ {
if (arg->type != MANAGESIEVE_ARG_STRING) if (arg->type != MANAGESIEVE_ARG_STRING)
return FALSE; return FALSE;
...@@ -52,38 +52,38 @@ bool managesieve_arg_get_quoted ...@@ -52,38 +52,38 @@ bool managesieve_arg_get_quoted
return TRUE; return TRUE;
} }
bool managesieve_arg_get_string bool managesieve_arg_get_string(const struct managesieve_arg *arg,
(const struct managesieve_arg *arg, const char **str_r) const char **str_r)
{ {
if (arg->type != MANAGESIEVE_ARG_STRING if (arg->type != MANAGESIEVE_ARG_STRING &&
&& arg->type != MANAGESIEVE_ARG_LITERAL) arg->type != MANAGESIEVE_ARG_LITERAL)
return FALSE; return FALSE;
*str_r = arg->_data.str; *str_r = arg->_data.str;
return TRUE; return TRUE;
} }
bool managesieve_arg_get_string_stream bool managesieve_arg_get_string_stream(const struct managesieve_arg *arg,
(const struct managesieve_arg *arg, struct istream **stream_r) struct istream **stream_r)
{ {
if ( arg->type != MANAGESIEVE_ARG_STRING_STREAM ) if (arg->type != MANAGESIEVE_ARG_STRING_STREAM)
return FALSE; return FALSE;
*stream_r = arg->_data.str_stream; *stream_r = arg->_data.str_stream;
return TRUE; return TRUE;
} }
bool managesieve_arg_get_list bool managesieve_arg_get_list(const struct managesieve_arg *arg,
(const struct managesieve_arg *arg, const struct managesieve_arg **list_r) const struct managesieve_arg **list_r)
{ {
unsigned int count; unsigned int count;
return managesieve_arg_get_list_full(arg, list_r, &count); return managesieve_arg_get_list_full(arg, list_r, &count);
} }
bool managesieve_arg_get_list_full bool managesieve_arg_get_list_full(const struct managesieve_arg *arg,
(const struct managesieve_arg *arg, const struct managesieve_arg **list_r, const struct managesieve_arg **list_r,
unsigned int *list_count_r) unsigned int *list_count_r)
{ {
unsigned int count; unsigned int count;
...@@ -98,8 +98,8 @@ bool managesieve_arg_get_list_full ...@@ -98,8 +98,8 @@ bool managesieve_arg_get_list_full
return TRUE; return TRUE;
} }
struct istream *managesieve_arg_as_string_stream struct istream *
(const struct managesieve_arg *arg) managesieve_arg_as_string_stream(const struct managesieve_arg *arg)
{ {
struct istream *stream; struct istream *stream;
...@@ -118,8 +118,8 @@ managesieve_arg_as_list(const struct managesieve_arg *arg) ...@@ -118,8 +118,8 @@ managesieve_arg_as_list(const struct managesieve_arg *arg)
return ret; return ret;
} }
bool managesieve_arg_atom_equals bool managesieve_arg_atom_equals(const struct managesieve_arg *arg,
(const struct managesieve_arg *arg, const char *str) const char *str)
{ {
const char *value; const char *value;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment

Consent

On this website, we use the web analytics service Matomo to analyze and review the use of our website. Through the collected statistics, we can improve our offerings and make them more appealing for you. Here, you can decide whether to allow us to process your data and set corresponding cookies for these purposes, in addition to technically necessary cookies. Further information on data protection—especially regarding "cookies" and "Matomo"—can be found in our privacy policy. You can withdraw your consent at any time.