Browse Source

core: core module tracking configuration etc.

bboozzoo/device-cache
Maciek Borzecki 10 years ago
parent
commit
b4d70155f4
2 changed files with 49 additions and 2 deletions
  1. +4
    -2
      Makefile.am
  2. +45
    -0
      src/core.vala

+ 4
- 2
Makefile.am View File

@ -7,11 +7,13 @@ mconnect_SOURCES = src/main.vala \
src/discovery.vala \
src/packet.vala \
src/device.vala \
src/devicemanager.vala
src/core.vala \
src/mconn-crypt.c \
src/mconn-crypt.h
mconnect_LDADD = $(MCONNECT_LIBS)
mconnect_CFLAGS = $(MCONNECT_CFLAGS)
mconnect_CFLAGS = $(MCONNECT_CFLAGS) -Isrc
test_mconn_crypt_SOURCES = test/mconn-crypt-test.c \
src/mconn-crypt.c \


+ 45
- 0
src/core.vala View File

@ -0,0 +1,45 @@
/* ex:ts=4:sw=4:sts=4:et */
/* -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */
/**
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
* AUTHORS
* Maciek Borzecki <maciek.borzecki (at] gmail.com>
*/
using MConn;
class Core : Object {
public Crypt crypt { get; private set; default = null; }
private static Core _instance = null;
private Core(Crypt crypt) {
debug("init core");
this.crypt = crypt;
}
public static Core? instance() {
if (Core._instance == null)
{
var crypt = new Crypt.for_key_path("private.pem");
var core = new Core(crypt);
Core._instance = core;
}
return Core._instance;
}
}

Loading…
Cancel
Save