Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How could one emulate namespace in C?

Tags:

c++

c

In C++ one might use namespace to keep independent groups working in the same code base from inadvertently creating functions with the same name and thus creating a conflict. My question is, before the idea of namespace comes out, how might one emulate namespace in C.

like image 880
skydoor Avatar asked Mar 20 '10 00:03

skydoor


1 Answers

By naming things differently, e.g.:

void namespace_group_function();

gtk+ is a prime example for this conventional style:

GtkWidget* gtk_window_new(GtkWindowType type);
like image 169
Georg Fritzsche Avatar answered Sep 20 '22 20:09

Georg Fritzsche