Add CFCGoMethod.
Project: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/repo Commit: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/commit/2ccd49cf Tree: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/tree/2ccd49cf Diff: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/diff/2ccd49cf Branch: refs/heads/master Commit: 2ccd49cfd5b10f1b2ca85509b10b9bcdeec1ebab Parents: 17dc892 Author: Marvin Humphrey <[email protected]> Authored: Mon Apr 6 20:12:00 2015 -0700 Committer: Marvin Humphrey <[email protected]> Committed: Wed May 6 14:25:27 2015 -0700 ---------------------------------------------------------------------- compiler/src/CFCGoMethod.c | 68 +++++++++++++++++++++++++++++++++++++++++ compiler/src/CFCGoMethod.h | 38 +++++++++++++++++++++++ 2 files changed, 106 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/2ccd49cf/compiler/src/CFCGoMethod.c ---------------------------------------------------------------------- diff --git a/compiler/src/CFCGoMethod.c b/compiler/src/CFCGoMethod.c new file mode 100644 index 0000000..ae1999e --- /dev/null +++ b/compiler/src/CFCGoMethod.c @@ -0,0 +1,68 @@ +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +#include <string.h> +#include <stdio.h> +#include <ctype.h> + +#define CFC_NEED_BASE_STRUCT_DEF +#include "CFCBase.h" +#include "CFCGoMethod.h" +#include "CFCUtil.h" +#include "CFCClass.h" +#include "CFCFunction.h" +#include "CFCMethod.h" +#include "CFCSymbol.h" +#include "CFCType.h" +#include "CFCParcel.h" +#include "CFCParamList.h" +#include "CFCGoTypeMap.h" +#include "CFCVariable.h" + +#ifndef true + #define true 1 + #define false 0 +#endif + +struct CFCGoMethod { + CFCBase base; + CFCMethod *method; +}; + +static void +S_CFCGoMethod_destroy(CFCGoMethod *self); + +static const CFCMeta CFCGOMETHOD_META = { + "Clownfish::CFC::Binding::Go::Method", + sizeof(CFCGoMethod), + (CFCBase_destroy_t)S_CFCGoMethod_destroy +}; + +CFCGoMethod* +CFCGoMethod_new(CFCMethod *method) { + CFCGoMethod *self + = (CFCGoMethod*)CFCBase_allocate(&CFCGOMETHOD_META); + self->method = (CFCMethod*)CFCBase_incref((CFCBase*)method); + return self; +} + +static void +S_CFCGoMethod_destroy(CFCGoMethod *self) { + CFCBase_decref((CFCBase*)self->method); + CFCBase_destroy((CFCBase*)self); +} + http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/2ccd49cf/compiler/src/CFCGoMethod.h ---------------------------------------------------------------------- diff --git a/compiler/src/CFCGoMethod.h b/compiler/src/CFCGoMethod.h new file mode 100644 index 0000000..be8c1a6 --- /dev/null +++ b/compiler/src/CFCGoMethod.h @@ -0,0 +1,38 @@ +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef H_CFCGOMETHOD +#define H_CFCGOMETHOD + +#ifdef __cplusplus +extern "C" { +#endif + +/** Clownfish::CFC::Binding::Go::Method - Binding for a method. + */ + +typedef struct CFCGoMethod CFCGoMethod; +struct CFCMethod; + +CFCGoMethod* +CFCGoMethod_new(struct CFCMethod *method); + +#ifdef __cplusplus +} +#endif + +#endif /* H_CFCGOMETHOD */ +
