src/error_handling.c
/*
**	This function will work out what the acceptable types are from the int,
**	(similar to how chmod's numeric codes work), and compare the param to the
**	acceptable list. If allowed, it returns true. Otherwise, it returns false.
*/
This function will work out what the acceptable types are from the int,
(similar to how chmod's numeric codes work), and compare the param to the
acceptable list. If allowed, it returns true. Otherwise, it returns false.
This function will work out what the acceptable types are from the int ( similar to how chmod ' s numeric codes work ) and compare the param to the acceptable list . If allowed it returns true . Otherwise it returns false .
static _Bool	compare_type(short type, char *param)
{
	_Bool	ind;
	_Bool	dir;
	_Bool	reg;
	ind = 0;
	dir = 0;
	reg = 0;
	if (type >= T_IND)
	{
		ind = 1;
		type -= T_IND;
	}
	if (type >= T_DIR)
	{
		dir = 1;
		type -= T_DIR;
	}
	if (type)
		reg = 1;
	if (param[0] == 'r')
		return (reg);
	else if (param[0] == DIRECT_CHAR)
		return (dir);
	else
		return (ind);
}
static _Bool compare_type ( short type , char * param ) { _Bool ind ; _Bool dir ; _Bool reg ; ind = 0 ; dir = 0 ; reg = 0 ; if ( type >= T_IND ) { ind = 1 ; type -= T_IND ; } if ( type >= T_DIR ) { dir = 1 ; type -= T_DIR ; } if ( type ) reg = 1 ; if ( param [ 0 ] == ' ' ) return ( reg ) ; else if ( param [ 0 ] == DIRECT_CHAR ) return ( dir ) ; else return ( ind ) ; }
This function will work out what the acceptable types are from the int,
(similar to how chmod's numeric codes work), and compare the param to the
acceptable list.
This function will work out what the acceptable types are from the int ( similar to how chmod ' s numeric codes work ) and compare the param to the acceptable list .