From 9eb00221aa7a8085d74ace52867fb204413a1212 Mon Sep 17 00:00:00 2001 From: Pierre Pronchery Date: Tue, 8 Jan 2013 19:45:34 +0100 Subject: [PATCH] Added variable_get_type() --- include/System/variable.h | 5 ++--- src/variable.c | 7 +++++++ 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/include/System/variable.h b/include/System/variable.h index 43eeb83..8086eab 100644 --- a/include/System/variable.h +++ b/include/System/variable.h @@ -1,5 +1,5 @@ /* $Id$ */ -/* Copyright (c) 2012 Pierre Pronchery */ +/* Copyright (c) 2012-2013 Pierre Pronchery */ /* This file is part of DeforaOS System libSystem */ /* This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by @@ -54,9 +54,8 @@ void variable_delete(Variable * variable); /* accessors */ int variable_get_as(Variable * variable, VariableType type, void * result); -int variable_get_as(Variable * variable, VariableType type, void * result); +VariableType variable_get_type(Variable * variable); -int variable_set_from(Variable * variable, VariableType type, void * value); int variable_set_from(Variable * variable, VariableType type, void * value); /* useful */ diff --git a/src/variable.c b/src/variable.c index 322f206..6bd6e7b 100644 --- a/src/variable.c +++ b/src/variable.c @@ -532,6 +532,13 @@ int variable_get_as(Variable * variable, VariableType type, void * result) } +/* variable_get_type */ +VariableType variable_get_type(Variable * variable) +{ + return variable->type; +} + + /* useful */ /* variable_serialize */ int variable_serialize(Variable * variable, Buffer * buffer, int type)