MCPcopy Create free account
hub / github.com/coreutils/coreutils / binop

Function binop

src/test.c:185–203  ·  view source on GitHub ↗

Return the type of S, one of the test command's binary operators. If S is not a binary operator, return -1. */

Source from the content-addressed store, hash-verified

183/* Return the type of S, one of the test command's binary operators.
184 If S is not a binary operator, return -1. */
185static int
186binop (char const *s)
187{
188 return ( streq (s, "=" ) ? EQ_STRING_BINOP
189 : streq (s, "==" ) ? EQ_STRING_BINOP /* an alias for = */
190 : streq (s, "!=" ) ? NE_STRING_BINOP
191 : streq (s, ">" ) ? GT_STRING_BINOP
192 : streq (s, "<" ) ? LT_STRING_BINOP
193 : streq (s, "-eq") ? EQ_BINOP
194 : streq (s, "-ne") ? NE_BINOP
195 : streq (s, "-lt") ? LT_BINOP
196 : streq (s, "-le") ? LE_BINOP
197 : streq (s, "-gt") ? GT_BINOP
198 : streq (s, "-ge") ? GE_BINOP
199 : streq (s, "-ot") ? OT_BINOP
200 : streq (s, "-nt") ? NT_BINOP
201 : streq (s, "-ef") ? EF_BINOP
202 : -1);
203}
204
205/*
206 * term - parse a term and return 1 or 0 depending on whether the term

Callers 2

termFunction · 0.70
three_argumentsFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected