0

I'm trying to understand libv4l2, & came across with following function that contains three dots in the argument part. What does this ... mean?

int v4l2_ioctl (int fd, unsigned long int request, ...)
{
  void *arg;
  va_list ap;
  int result, index, saved_err;
  int is_capture_request = 0, stream_needs_locking = 0;

Also, my C knowledge is poor. So please, Explain Like I’m 5


I'm expecting to understand that does ... meant in a function, I've done basic search about these three-dots, but only found something related with C's Macro (not good results with something related with C functions). My long-term goal is to understand about this v4l2-ioctl function, (not like understand in and out) but understand briefly so I can use this v4l2-ioctl comfortably.

Garid
  • 105
  • 1
  • 3

1 Answers1

1

its a variadic function- a function that can take a variable number of arguments

you have to access them with va_start, va_arg and va_end

if u want to read more about it u can here:

http://publications.gbdirect.co.uk/c_book/chapter9/stdarg.html

guimbreon
  • 26
  • 3