flinklib
flinklib: flink C library for Linux
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
valid.c
Go to the documentation of this file.
1 /*******************************************************************
2  * _________ _____ _____ ____ _____ ___ ____ *
3  * |_ ___ | |_ _| |_ _| |_ \|_ _| |_ ||_ _| *
4  * | |_ \_| | | | | | \ | | | |_/ / *
5  * | _| | | _ | | | |\ \| | | __'. *
6  * _| |_ _| |__/ | _| |_ _| |_\ |_ _| | \ \_ *
7  * |_____| |________| |_____| |_____|\____| |____||____| *
8  * *
9  *******************************************************************
10  * *
11  * fLink userspace library, validation functions *
12  * *
13  *******************************************************************/
14 
21 #include "valid.h"
22 
29  if(dev && dev->fd != 0) {
30  return 1; // device struct valid
31  }
32  return 0;
33 }
34 
41  if(subdev->parent) {
42  return 1; // subdevice struct valid
43  }
44  return 0;
45 }
int validate_flink_subdev(flink_subdev *subdev)
Checks if flink subdevice belongs to the device.
Definition: valid.c:40
Contains validation functions for flink.
int validate_flink_dev(flink_dev *dev)
Checks if flink device was opened.
Definition: valid.c:28