Quantcast Need some clarification regarding "C_xxxxxx" functions - WoWInterface
Thread Tools Display Modes
05-11-18, 09:22 PM   #1
seyan777
A Fallenroot Satyr
Join Date: Feb 2017
Posts: 28
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: 345
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: 150
I think C_XXXX functions are not written in Lua but in C.
__________________
"In this world nothing can be said to be certain, except death and taxes." - Benjamin Franklin
  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.
__________________
Author/maintainer of Grid, PhanxChat, oUF_Phanx, and many more.
Troubleshoot an addonTurn any code into an addonMore addon resources
Need help with your code? Post all of your actual code! Attach or paste your files.
Please don’t PM me about addon bugs or code questions. Post a comment or forum thread instead!
  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