/* Initialize all fields of the specified tcw data structure with zero and fill in the format, flags, r and w fields.  */
void tcw_init(struct tcw *tcw, int r, int w)
/* Initialize all fields of the specified tcw data structure with zero and fill in the format, flags, r and w fields.  */
void tcw_init(struct tcw *tcw, int r, int w)
{
	memset(tcw, 0, sizeof(struct tcw));
	tcw->format = TCW_FORMAT_DEFAULT;
	tcw->flags = TCW_FLAGS_TIDAW_FORMAT(TCW_TIDAW_FORMAT_DEFAULT);
	if (r)
		tcw->r = 1;
	if (w)
		tcw->w = 1;
}