Hi,
Can anybody explain this..
#define LIST_DESTROY(a) list_destroy(a)
#define LIST_ENQUEUE(a, b, c) list_enqueue(a,b,c)
#define LIST_REMOVE(a, b, c) list_remove(a,b,c)
etc...
#define LIST_DESTROY(a) NULL
#define LIST_ENQUEUE(a, b, c) NULL
#define LIST_REMOVE(a, b, c) NULL
#define LIST_HEAD_ELEMENT(a) NULL
#define LIST_GET_DATA(a) NULL
#define LIST_NEXT_ELEMENT(a) NULL
#define LIST_EMPTY(a) NULL
#define FOR_ALL_DATA_IN_LIST(__list, __element, __data) \
for (__element = LIST_HEAD_ELEMENT(__list), \
__data = LIST_GET_DATA(__element); \
__element != NULL; \
__element = LIST_NEXT_ELEMENT(__element), \
__data = LIST_GET_DATA(__element))
Though the name of the MACRO is self-explanatory what i dont understand is
the second list of #define's - why are they defined as NULL
Thanks,
- Ravi 2 1493
Ravi Uday wrote: Can anybody explain this..
Possibly..
#define LIST_DESTROY(a) list_destroy(a) #define LIST_ENQUEUE(a, b, c) list_enqueue(a,b,c) #define LIST_REMOVE(a, b, c) list_remove(a,b,c) etc...
#define LIST_DESTROY(a) NULL #define LIST_ENQUEUE(a, b, c) NULL #define LIST_REMOVE(a, b, c) NULL #define LIST_HEAD_ELEMENT(a) NULL #define LIST_GET_DATA(a) NULL #define LIST_NEXT_ELEMENT(a) NULL #define LIST_EMPTY(a) NULL
#define FOR_ALL_DATA_IN_LIST(__list, __element, __data) \ for (__element = LIST_HEAD_ELEMENT(__list), \ __data = LIST_GET_DATA(__element); \ __element != NULL; \ __element = LIST_NEXT_ELEMENT(__element), \ __data = LIST_GET_DATA(__element))
Though the name of the MACRO is self-explanatory what i dont understand is the second list of #define's - why are they defined as NULL
In divination mode, I'd say there's probably an #if or an #ifdef
somewhere, but I think this link may be helpful: http://www.catb.org/~esr/faqs/smart-questions.html
HTH
rlc
Ravi Uday wrote: Hi,
Can anybody explain this..
#define LIST_DESTROY(a) list_destroy(a) #define LIST_ENQUEUE(a, b, c) list_enqueue(a,b,c) #define LIST_REMOVE(a, b, c) list_remove(a,b,c) etc...
#define LIST_DESTROY(a) NULL #define LIST_ENQUEUE(a, b, c) NULL #define LIST_REMOVE(a, b, c) NULL #define LIST_HEAD_ELEMENT(a) NULL #define LIST_GET_DATA(a) NULL #define LIST_NEXT_ELEMENT(a) NULL #define LIST_EMPTY(a) NULL
#define FOR_ALL_DATA_IN_LIST(__list, __element, __data) \ for (__element = LIST_HEAD_ELEMENT(__list), \ __data = LIST_GET_DATA(__element); \ __element != NULL; \ __element = LIST_NEXT_ELEMENT(__element), \ __data = LIST_GET_DATA(__element))
Though the name of the MACRO is self-explanatory what i dont understand is the second list of #define's - why are they defined as NULL
Thanks, - Ravi
It's seems that the user of this library must provide his redefinitions
of macroses that have been defined as NULL to use this. The main purpose
is something like C++ template construction. I don't know the details
and I can't comment the design. Sometimes it's better to use void*
instead of macroses in C. But if you really need lots of generic
procedures try switching to C++.
--
vir This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Bruce D |
last post by:
I'm trying to understand MySQL better. I can't seem to figure out why the
second query takes 2 minutes and the first query takes 12 seconds. It
should be noted that the table, KBM, has 250...
|
by: Greg Stark |
last post by:
This query is odd, it seems to be taking over a second according to my
log_duration logs and according to psql's \timing numbers. However explain
analyze says it's running in about a third of a...
|
by: Ina Schmitz |
last post by:
Hello all,
I don't succeed in displaying the explain plan. I use IBM DB2 Universal
Database 8.2.
I tried to do the example given in the online help for "Visual Explain".
The tables...
|
by: Buck Nuggets |
last post by:
Since upgrading to db2 8.2.1 I've been having odd problems with visual
explain:
1. tables appear to require schema prefixes:
SQL0204N "BUCK.DIM_SENSOR"
is an undefined name. SQLSTATE=42704...
|
by: Jeff Boes |
last post by:
I'm hoping there's someone here with experience in building the Visual
Explain tool from Red Hat. I downloaded it and the J2 SDK, but when I
attempt to follow the build instructions, I get messages...
|
by: Jon Lapham |
last post by:
I have been using the EXPLAIN ANALYZE command to debug some performance
bottlenecks in my database. In doing so, I have found an oddity (to me
anyway). The "19ms" total runtime reported below...
|
by: marklawford |
last post by:
Not having earned my DBA badge from the scouts just yet I'm a little
lost with an error I'm getting.
We've just upgraded our development database from 7.2 to 8.2 as the
first step in upgrading...
|
by: heming_g |
last post by:
two tables with the same table structure : tb_xxx and tb_xxx_tmp
in table tb_xxx , column "listno" is the primary key of itself and
foreign key of dozen of tables .
here is my sql .. "...
|
by: kabotnet |
last post by:
Hi,
I'm new in db2, I'm trying to execute EXPLAIN command on some queries
but i have error like:
And message similar to: Token EXPLAIN is not valid, valid tokens ( END
GET SET CALL DROP FREE...
|
by: w.l.fischer |
last post by:
Hi,
the following sequence:
set current explain mode yes;
set current explain snapshot yes;
update ...;
set current explain mode no;
|
by: CloudSolutions |
last post by:
Introduction:
For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
|
by: ryjfgjl |
last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: aa123db |
last post by:
Variable and constants
Use var or let for variables and const fror constants.
Var foo ='bar';
Let foo ='bar';const baz ='bar';
Functions
function $name$ ($parameters$) {
}
...
|
by: ryjfgjl |
last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
| |