Added header guard to device.h, wrote typedef in a cleaner way
[mtetherd] / device.h
index fe8c55c..b21cd3e 100644 (file)
--- a/device.h
+++ b/device.h
   along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
 
-struct Device;
+#ifndef _MTETHERD_DEVICE_H
+#define _MTETHERD_DEVICE_H
 
-typedef struct Device {
+typedef struct _Device Device;
+
+struct _Device {
        char *name;
        char *address;
        char *startaddress;
        char *endaddress;
-       struct Device *previous;
-       struct Device *next;
-} Device;
+       Device *previous;
+       Device *next;
+};
 
 // Allocates memory for a device structure and copies the name
 Device *device_new(const char *name);
@@ -60,3 +63,6 @@ int device_validate(Device *device);
 // Searches for a device name, starting from start and returns a pointer
 // to the matching node, or NULL if no name matches
 Device *device_search(Device *start, const char *name);
+
+#endif //_MTETHERD_DEVICE_H
+