---
title: "LOCAL_C, LOCAL_D, GLREF_C, GLREF_D, GLDEF_C and GLDEF_D "
author: "enter775"
date: "2009-11-07T15:40:00Z"
tags: []
slug: "local-c-local-d-glref-c-glref-d-gldef-c-and-gldef-d"
draft: false
lastmod: "2009-11-07T15:40:00Z"
id: 512066
url: "https://enter775.iteye.com/blog/512066"
---

LOCAL\_C , LOCAL\_D , GLREF\_C, GLREF\_D, GLDEF\_C and GLDEF\_D are all defined in e32def.h as:

#define GLREF\_D extern  
#define GLDEF\_D  
#define LOCAL\_D static  
#define GLREF\_C extern  
#define GLDEF\_C  
#define LOCAL\_C static

The \_C and \_D suffixes are a convention. \_D indicates a data declaration, and \_C a code one.

So LOCAL\_D is used to indicate a static data while LOCAL\_C indicates static code.

By contrast, GLREF\_C and GLREF\_D, by contrast, are used to indicated GLobal REFerences (i.e. extern), and GLDEF\_C and GLDEF\_D indicate GLobal DEFinitions. These terms don’t have a formal definition but are used as markers for functions or variables which have been declared as GLREF\_C or GLREF\_D respectively elsewhere.

 

这些宏被定义在 e32def.h 头文件中，如下：

#define GLREF\_D extern  
#define GLDEF\_D  
#define LOCAL\_D static  
#define GLREF\_C extern  
#define GLDEF\_C  
#define LOCAL\_C static

后缀 \_D 和 \_C 是 EPOC 的的一个约定，\_D 指数据声明(declaration of D ata)，\_C 指代码定义(definition of C ode)。

这里，static 被 LOCAL\_C 和 LOCAL\_D 所取代。

GLREF\_C 和 GLREF\_D 被指定为全局引用(GLobal REFerence)：extern 。

GLDEF\_C 和 GLDEF\_D 指定了一个全局定义(GLobal DEFination)。这两个宏没有给出一个固定的定义，但是它们被作为函数和变量的记号。