Tremulous Forum
Mods => Modding Center => Topic started by: Bomb on July 04, 2008, 02:37:05 am
-
Hello everyone.
I've seen various functions in the SVN with names like Q_strcmp, Q_stricmp, Q_strncmp, Q_strncpy, etc. Can someone please tell me what these do and how to use them?
-
exactly the same thing as their crt equivalents (in fact if building shared objects they ARE the crt versions)
-
I'm sorry, but could you rephrase that? So a non-pro like myself can understand?
-
google "c strcmp" "c strncmp" etc.
Each of those (minus the Q_ prefix) is a function in C. The versions that the VMs use will behave the same way, so far as you're concerned.
-
(in fact if building shared objects they ARE the crt versions)
That is true of the functions in bg_lib.c (which have the same names as the CRT equivalent). It is not true of the Q_* functions.
-
Virtually all of them are defined in src/qcommon/q_shared.c, and most of them are actually pretty simple.
The Q_ is short for Quake, and ensures that the functions used are the ones in q_shared.c rather than in system libraries, for consistency.
-
Ahhh. Well, I googled "c strcmp" and it was very helpful. Thanks all.
-
They are all string manipulating/comparing functions.