File: README

package info (click to toggle)
mcs 0.7.2-2.1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 784 kB
  • sloc: sh: 3,466; ansic: 1,401; cpp: 210; makefile: 103
file content (144 lines) | stat: -rw-r--r-- 3,748 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
mcs - modular config system
-=-=-=-=-=-=-=-=-=-=-=-=-=-

mcs is free but copyrighted software, check COPYING for details.

Contents
--------

1. What is mcs?
2. Available storage backends
3. Installation
4. Using mcs in your programs
5. Reporting a bug that you have found in mcs
6. The mcs userland tools

1. What is mcs?
-=-=-=-=-=-=-=-

mcs is a library and set of userland tools which abstract the
storage of configuration settings away from userland applications.

It is hoped that by using mcs, that the applications which use it
will generally have a more congruent feeling in regards to settings.

There have been other projects like this before (such as GConf), but
unlike those projects, mcs strictly handles abstraction. It does not
impose any specific data storage requirement, nor is it tied to any
desktop environment or software suite.

Because mcs is licenced under the BSD license, it is hoped that many
applications will adopt it's use.


2. Available storage backends
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

The default storage backend (unless a different one is set in your
environment), is one which stores freedesktop.org keyfile standard
compliant files in accordance to the freedesktop XDG specification.

Additionally, a GConf storage backend is available for users who
would prefer to use that instead.

To temporarily change the selected storage backend, simply export
the MCS_BACKEND environment variable, and mcs will handle the
rest automatically.

You can also change the backend that mcs uses permanantly, in both
the scope of a user account, and the default site-wide setting used.

To set a different backend for a user account, simply run:

  $ echo "gconf" > $HOME/.mcs-backend

This will set the storage backend to gconf for the local user.

To set a different default backend, you can do the same, but
the filepath should be /etc/mcs-backend, or whatever your
system configuration directory is, if it is not /etc.

The selected backend can be verified by using the mcs-info(1)
utility.


3. Installation
-=-=-=-=-=-=-=-

Installation is fairly typical:

  $ ./configure
  $ make
  $ sudo make install

(If sudo isn't on your system, su to root.)


4. Using mcs in your programs
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

A simple example would be this snippet of C code:

  #include <libmcs/mcs.h>

  int main(int argc, const char *argv[])
  {
     mcs_handle_t *mcs;
     char *foo;

     mcs_init();

     mcs = mcs_new("fooapp");
     foo = "fooapp rocks!";

     mcs_set_string(mcs, "general", "infoline", foo);

     mcs_get_string(mcs, "general", "infoline", &foo);

     printf("%s\n", foo);

     mowgli_object_unref(mcs);

     mcs_fini();

     return 0;
  }

When run, this program would produce:

  fooapp rocks!

The following keys in mcs would be created and committed to the
configuration database:

  /fooapp/general/infoline = "fooapp rocks!"


5. Reporting a bug that you have found in mcs
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

Please open a bug on our JIRA instance at:
   http://jira.atheme.org/

You will want to select the libmcs project for reporting bugs.


6. The mcs userland tools
-=-=-=-=-=-=-=-=-=-=-=-=-

mcs includes a number of userland tools for the maintainance of the
mcs system. These tools are:

   mcs-query-backends: Queries mcs for what backends are available.
   mcs-getconfval    : Queries mcs for a configuration value.
   mcs-setconfval    : Instructs mcs to change a configuration
                       value.
   mcs-info          : Displays information about the current
                       installation and configuration of mcs.

Other tools will be added as they are found to be necessary.

Thank you for using mcs.

--
William Pitcock <nenolod -at- sacredspiral.co.uk>