1.Dd March 11, 2017 2.Dt SQLITE3_SNAPSHOT_CMP 3 3.Os 4.Sh NAME 5.Nm sqlite3_snapshot_cmp 6.Nd Compare the ages of two snapshot handles. 7.Sh SYNOPSIS 8.Ft int 9.Fo sqlite3_snapshot_cmp 10.Fa "sqlite3_snapshot *p1" 11.Fa "sqlite3_snapshot *p2 " 12.Fc 13.Sh DESCRIPTION 14The sqlite3_snapshot_cmp(P1, P2) interface is used to compare the ages 15of two valid snapshot handles. 16.Pp 17If the two snapshot handles are not associated with the same database 18file, the result of the comparison is undefined. 19.Pp 20Additionally, the result of the comparison is only valid if both of 21the snapshot handles were obtained by calling sqlite3_snapshot_get() 22since the last time the wal file was deleted. 23The wal file is deleted when the database is changed back to rollback 24mode or when the number of database clients drops to zero. 25If either snapshot handle was obtained before the wal file was last 26deleted, the value returned by this function is undefined. 27.Pp 28Otherwise, this API returns a negative value if P1 refers to an older 29snapshot than P2, zero if the two handles refer to the same database 30snapshot, and a positive value if P1 is a newer snapshot than P2. 31