The correct answer is C. both effective stress and total stress.
Shear strength is the maximum shear stress that a soil can withstand before it fails. It is a function of both the effective stress and the total stress. The effective stress is the difference between the total stress and the pore water pressure. The total stress is the total force per unit area acting on the soil, and the pore water pressure is the pressure of the water in the soil pores.
The effective stress is the driving force for shear failure, while the total stress is the resisting force. The shear strength of a soil is therefore a function of both the effective stress and the total stress.
Option A is incorrect because the shear strength of a soil is not a unique function of effective stress. The shear strength of a soil is also a function of the total stress.
Option B is incorrect because the shear strength of a soil is not a unique function of total stress. The shear strength of a soil is also a function of the effective stress.
Option D is incorrect because the shear strength of a soil is a function of both effective stress and total stress.