amath  1.8.5
Simple command line calculator
strcmp.c File Reference

Compare two null terminated strings to each other. More...

#include "amathc.h"
Include dependency graph for strcmp.c:

Go to the source code of this file.

Functions

bool StrIsEqual (const char *s1, const char *s2)
 Compare two null terminated strings to each other. More...
 

Detailed Description

Compare two null terminated strings to each other.

Code originate from FreeBSD base, revision 229286.

The original source code can be obtained from: https://svnweb.freebsd.org/base/head/lib/libc/string/strcmp.c?revision=229286

Definition in file strcmp.c.

Function Documentation

◆ StrIsEqual()

bool StrIsEqual ( const char *  s1,
const char *  s2 
)

Compare two null terminated strings to each other.

Definition at line 50 of file strcmp.c.

Referenced by VariableList::CreateVariable(), FunctionList::Delete(), FunctionList::FindAlias(), Language::FindAlias(), FunctionList::GetFunctionCall(), FunctionList::GetFunctionDef(), Language::GetHelpText(), FunctionList::GetSystemFunction(), VariableList::GetVariable(), StandardProgram::Initialize(), CharBuffer::Is(), StandardFilesystem::ListDirectory(), CharBuffer::RemoveTrailing(), and StandardLanguage::StrIsEqualLoc().

51 {
52  int r;
53 
54  while (*s1 == *s2++)
55  if (*s1++ == '\0')
56  return true;
57 
58  r = (*(const unsigned char *)s1 - *(const unsigned char *)(s2 - 1));
59 
60  return r == 0;
61 }
Here is the caller graph for this function: