News:

Come Chat with us live! Learn how HERE!

Main Menu

[SOLVED] Q_strcmp, Q_stricmp, etc...

Started by Bomb, July 04, 2008, 02:37:05 AM

Bomb

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?

kevlarman

exactly the same thing as their crt equivalents (in fact if building shared objects they ARE the crt versions)
Quote from: Asvarox link=topic=8622.msg169333#msg169333Ok let's plan it out. Asva, you are nub, go sit on rets, I will build, you two go feed like hell, you go pwn their asses, and everyone else camp in the hallway, roger?
the dretch bites.
-----
|..d| #
|.@.-##
-----

Bomb

#2
I'm sorry, but could you rephrase that? So a non-pro like myself can understand?

Lakitu7

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.

Undeference

Quote from: kevlarman on July 04, 2008, 03:46:59 AM
(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.
Need help? Ask intelligently. Please share solutions you find.

Quote from: tuple on February 15, 2008, 11:54:10 PMThats what we need, helpful players, not more powerful admins.

benmachine

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.
benmachine

Bomb

Ahhh. Well, I googled "c strcmp" and it was very helpful. Thanks all.

Bissig

They are all string manipulating/comparing functions.