2009-08-27 16:45:31 +04:00
|
|
|
/*
|
|
|
|
* Copyright 2009, Haiku, Inc. All rights reserved.
|
|
|
|
* Distributed under the terms of the MIT License.
|
|
|
|
*/
|
2002-10-22 20:29:21 +04:00
|
|
|
#ifndef _NET_SETTINGS_H
|
|
|
|
#define _NET_SETTINGS_H
|
|
|
|
|
2009-08-27 16:45:31 +04:00
|
|
|
|
2002-10-22 20:29:21 +04:00
|
|
|
#include <SupportDefs.h>
|
|
|
|
|
|
|
|
#if __cplusplus
|
2009-08-27 16:45:31 +04:00
|
|
|
extern "C" {
|
2002-10-22 20:29:21 +04:00
|
|
|
#endif /* __cplusplus */
|
|
|
|
|
2009-08-27 16:45:31 +04:00
|
|
|
|
|
|
|
/* private types */
|
2002-10-22 20:29:21 +04:00
|
|
|
typedef struct _ns_entry {
|
2009-08-27 16:45:31 +04:00
|
|
|
const char* key;
|
|
|
|
const char* value;
|
2002-10-22 20:29:21 +04:00
|
|
|
} _ns_entry_t;
|
|
|
|
|
|
|
|
typedef struct _ns_section {
|
2009-08-27 16:45:31 +04:00
|
|
|
const char* heading;
|
|
|
|
unsigned nentries;
|
|
|
|
_ns_entry_t* entries;
|
2002-10-22 20:29:21 +04:00
|
|
|
} _ns_section_t;
|
|
|
|
|
|
|
|
|
2009-08-27 16:45:31 +04:00
|
|
|
/* public type (data members are private) */
|
2002-10-22 20:29:21 +04:00
|
|
|
typedef struct _net_settings {
|
2009-08-27 16:45:31 +04:00
|
|
|
int _dirty;
|
|
|
|
unsigned _nsections;
|
|
|
|
_ns_section_t* _sections;
|
|
|
|
char _fname[64];
|
2002-10-22 20:29:21 +04:00
|
|
|
} net_settings;
|
|
|
|
|
2009-08-27 16:45:31 +04:00
|
|
|
/* finding and setting network preferences */
|
|
|
|
extern char* find_net_setting(net_settings* ncw, const char* heading,
|
|
|
|
const char* name, char* value, unsigned nbytes);
|
|
|
|
|
|
|
|
extern status_t set_net_setting(net_settings* ncw, const char* heading,
|
|
|
|
const char* name, const char* value);
|
|
|
|
|
2002-10-22 20:29:21 +04:00
|
|
|
|
|
|
|
#if __cplusplus
|
|
|
|
}
|
|
|
|
#endif /* __cplusplus */
|
|
|
|
|
|
|
|
#endif /* _NET_SETTINGS_H */
|