MCPcopy Create free account
hub / github.com/FirebirdSQL/firebird / find_type

Function find_type

src/jrd/pag.cpp:2093–2144  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2091
2092
2093static bool find_type(thread_db* tdbb,
2094 WIN* window,
2095 PAG* ppage,
2096 USHORT lock,
2097 USHORT type,
2098 UCHAR** entry_p,
2099 const UCHAR** clump_end)
2100{
2101/***********************************************
2102 *
2103 * f i n d _ t y p e
2104 *
2105 ***********************************************
2106 *
2107 * Functional description
2108 * Find the requested type in a page.
2109 * RETURNS
2110 * pointer to type, pointer to end of page, header.
2111 * true - Found it
2112 * false - Not present
2113 *
2114 **************************************/
2115 SET_TDBB(tdbb);
2116
2117 while (true)
2118 {
2119 header_page* header = (header_page*) (*ppage);
2120 UCHAR* p = header->hdr_data;
2121 const SLONG next_page = header->hdr_next_page;
2122
2123 UCHAR* q = 0;
2124 for (; (*p != HDR_end); p += 2u + p[1])
2125 {
2126 if (*p == type)
2127 q = p;
2128 }
2129
2130 if (q)
2131 {
2132 *entry_p = q;
2133 *clump_end = p;
2134 return true;
2135 }
2136
2137 // Follow chain of pages
2138
2139 if (next_page)
2140 *ppage = CCH_HANDOFF(tdbb, window, next_page, lock, pag_header);
2141 else
2142 return false;
2143 }
2144}
2145
2146
2147// Class PageSpace starts here

Callers 3

add_clumpFunction · 0.85
PAG_delete_clump_entryFunction · 0.85
PAG_get_clumpFunction · 0.85

Calls 2

SET_TDBBFunction · 0.85
CCH_HANDOFFFunction · 0.85

Tested by

no test coverage detected