Header And Logo

PostgreSQL
| The world's most advanced open source database.

Functions

memcmp.c File Reference

#include "c.h"
Include dependency graph for memcmp.c:

Go to the source code of this file.

Functions

int memcmp (const void *s1, const void *s2, size_t n)

Function Documentation

int memcmp ( const void *  s1,
const void *  s2,
size_t  n 
)

Definition at line 56 of file memcmp.c.

Referenced by aclequal(), array_eq(), BeginCopyFrom(), bf_check_supported_key_len(), bit_cmp(), bitncmp(), bpchareq(), bpcharne(), byteacmp(), byteaeq(), byteage(), byteagt(), byteale(), bytealt(), byteane(), byteapos(), check_key_sha1(), CheckIndexCompatible(), CheckRADIUSAuth(), cmp(), colorTrgmInfoCmp(), comparePairs(), create_merge_append_plan(), datumIsEqual(), dotrim(), eq_s(), eq_s_b(), ExecEvalArray(), find_header(), find_str(), func_get_detail(), FuncnameGetCandidates(), FunctionIsVisible(), gbt_bytea_pf_match(), gist_tqcmp(), gtrgm_consistent(), gtrgm_distance(), gtrgm_penalty(), hstore_cmp(), hstore_concat(), hstore_contains(), hstore_delete(), hstore_delete_array(), hstore_delete_hstore(), hstoreFindKey(), hstoreUniquePairs(), inner_isparent(), int2vectoreq(), internal_bpchar_pattern_compare(), internal_load_library(), internal_text_pattern_compare(), isValidTarHeader(), json_lex(), lca_inner(), LookupFuncName(), ltree_compare(), ltree_index(), mdc_finish(), mdcbuf_finish(), mXactCacheGetBySet(), pg_stat_get_activity(), pg_stat_get_backend_client_addr(), pg_stat_get_backend_client_port(), pglz_find_match(), pgp_get_keyid(), pgp_parse_pubenc_sesskey(), pgstat_report_stat(), pgstat_send_bgwriter(), pgstat_send_funcstats(), RE_compile_and_cache(), regprocedurein(), spg_text_inner_consistent(), spg_text_leaf_consistent(), suppress_redundant_updates_trigger(), texteq(), textne(), toast_insert_or_update(), translate(), tsCompareString(), uuid_internal_cmp(), and varstr_cmp().

{
    if (n != 0)
    {
        const unsigned char *p1 = s1,
                   *p2 = s2;

        do
        {
            if (*p1++ != *p2++)
                return (*--p1 - *--p2);
        } while (--n != 0);
    }
    return 0;
}