Thread Tools Display Modes
05-11-18, 09:22 PM   #1
seyan777
An Aku'mai Servant
Join Date: Feb 2017
Posts: 35
Need some clarification regarding "C_xxxxxx" functions

For example, there are C_ArtifactUI, C_EncounterJournal and etc. which holds bunch of their own functions.

But, why do they all have prefix "C_"? How are they different from ordinary functions?
  Reply With Quote
05-12-18, 02:03 AM   #2
VincentSDSH
Non-Canadian Luzer!
 
VincentSDSH's Avatar
AddOn Author - Click to view addons
Join Date: Jun 2006
Posts: 350
They aren't different from the normal APIs. The naming convention is likely for internal housekeeping and organization, differentiating them from Lua functions from their Addons, such as this line from addons\Blizzard_MapCanvas.lua, in :RefreshDetailLayers()
Lua Code:
  1. for layerIndex = 1, C_MapCanvas.GetNumDetailLayers(self.mapID) do
If you called that MapCanvas.GetNumDetailLayers, then there'd be some question as to whether it was a Lua function or a C function, which can be a huge debugging headache for a developer (I speak from experience).
__________________
AddonsExecutive Assistant User Configurable To-Do ListLegible Mail Choose the Font for Your Mail
  Reply With Quote
05-12-18, 02:57 AM   #3
Banknorris
A Chromatic Dragonspawn
 
Banknorris's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2014
Posts: 153
I think C_XXXX functions are not written in Lua but in C.
__________________
"In this world nothing can be said to be certain, except that fractional reserve banking is a Ponzi scheme and that you won't believe it." - Mandrill
  Reply With Quote
05-12-18, 06:14 AM   #4
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
Originally Posted by Banknorris View Post
I think C_XXXX functions are not written in Lua but in C.
Yes, that's the whole point of everything explained in this thread.
__________________
Retired author of too many addons.
Message me if you're interested in taking over one of my addons.
Don’t message me about addon bugs or programming questions.
  Reply With Quote

WoWInterface » Developer Discussions » General Authoring Discussion » Need some clarification regarding "C_xxxxxx" functions

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off