xid.c

来自「关系型数据库 Postgresql 6.5.2」· C语言 代码 · 共 77 行

C
77
字号
/*------------------------------------------------------------------------- * * xid.c *	  POSTGRES transaction identifier code. * * Copyright (c) 1994, Regents of the University of California * *	$Id: xid.c,v 1.22.2.2 1999/08/02 05:56:49 scrappy Exp $ * * OLD COMMENTS * XXX WARNING *		Much of this file will change when we change our representation *		of transaction ids -cim 3/23/90 * * It is time to make the switch from 5 byte to 4 byte transaction ids * This file was totally reworked. -mer 5/22/92 * *------------------------------------------------------------------------- */#include "postgres.h"#include "access/xact.h"extern TransactionId NullTransactionId;extern TransactionId DisabledTransactionId;extern TransactionId AmiTransactionId;extern TransactionId FirstTransactionId;/* XXX name for catalogs */TransactionIdxidin(char *representation){	return atol(representation);}/* XXX name for catalogs */char *xidout(TransactionId transactionId){	/* maximum 32 bit unsigned integer representation takes 10 chars */	char	   *representation = palloc(11);	snprintf(representation, 11, "%u", transactionId);	return representation;}/* ---------------------------------------------------------------- *		xideq * ---------------------------------------------------------------- *//* *		xideq			- returns 1, iff xid1 == xid2 *								  0  else; */boolxideq(TransactionId xid1, TransactionId xid2){	return (bool) (xid1 == xid2);}/* ---------------------------------------------------------------- *		TransactionIdAdd * ---------------------------------------------------------------- */voidTransactionIdAdd(TransactionId *xid, int value){	*xid += value;	return;}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?