code/library for microsd card in C

I am looking for a library or C code to interface microsd card with my AVR micro .
can someone help ?

can someone help ?

In C? No.

C++ tho:

CrossRoads:
C++ tho:
GitHub - greiman/SdFat: Arduino FAT16/FAT32 exFAT Library

thanks
I downloaded the code and I see two folders , which one should I use ?

SdFat
SdFatTestSuite

which one should I use ?

For what? One contains the library. The other contains some test code, to validate that the library and your hardware work.

ok I see what you mean.
all the examples in the folder are for arduino .
are there any examples available for AVR ? if not can you help me in creating a simple main.cpp file to initialize the SD card and read and write to it ?

where would I set/define the CS pin ? I believe one GPIO from micro is needed to control the microSD card .

are there any examples available for AVR ?

I do not know what you mean by "the AVR". Atmel, who makes the chips that the Arduinos use, makes AVR chips and SAM chips. Some Arduinos use AVR chips, some use SAM chips.

The SdFat library works on all Arduinos that use AVR chips.

If you are not using the Arduino IDE to program your Arduino, why not?

If you aren't, though, this isn't the place to get help with some other process. Go to the forum for the process you are using.