comp.lang.c
  Home FAQ Contact Sign in
comp.lang.c only
 
Advanced search
May 2008
motuwethfrsasuw
   1234 18
567891011 19
12131415161718 20
19202122232425 21
262728293031  22
2008
 Jan   Feb   Mar   Apr 
 May   Jun   Jul   Aug 
 Sep   Oct   Nov   Dec 
2008 2007 2006  
total
comp.lang.c Profile…
RELATED GROUPS

POPULAR GROUPS

more...

 Up
  Installing a C function into the IDT         


Author: The Prisoner
Date: May 8, 2008 13:47

Hey-

I was reading about interrupts, and I got to thinking it would be a real
neat thing to use interrupts for program-wide exception handling. What I
haven't been able to find is a clear guide or example program for how to
install a C function into the IDT. And what happens about passing arguments?

I'd like to have something like this:

void malloc_failure();

Say I install this as interrupt slot 42, then I can do:

if(!(p=(int*)malloc(1000*4))) // array of 1000 ints
__asm__ ("int $0x42");

Is there any reason for this not to work? How do I set up the
interrupts? Would I need root privelidges to do that?

Thanks!!
16 Comments
  Compile OCI and Postgres         


Author: iavian
Date: May 8, 2008 12:59

I have a C Code like below with refers to both Oracle and Postgres
client libraries

#include "postgres.h"
#include "fmgr.h"
#include
#include
#include
#include

make -f demo_rdbms.mk build OBJS=pemsPg.o

pemsPg.c:1:22: postgres.h: No such file or directory
pemsPg.c:2:18: fmgr.h: No such file or directory
3 Comments
  Memory Allocation : Static or Dynamic?         


Author: swornavidhya.mahadevan
Date: May 8, 2008 09:58

Which allocation (Static / Dynamic) is suitable for the situation when
we are trying to allocate for a overloaded memory when the memory is
full and no space to allocate.
What will happen if both the allocation is impossible.

Sworna vidhya
10 Comments
  Two dimensional array Question         


Author: mdh
Date: May 8, 2008 08:16

I am still having a problem understanding K&RII on p 112. I have
looked at the FAQs --which I am sure answer it in a way that I have
missed, so here goes.
A 2-dim array, (per K&R) is really a 1-dim array, each of whose
elements is an array.
Looking at the debugger I use, arr[2][13] is shown as an initial value
of "2", but when expanded, there are 2 consecutive arrays of 13
elements.
So, may I ask this?
Is there anything special that marks the end of the first 13 elements
from the beginning of the 2nd 13 elements? In other words, it seems to
me that this is nothing more than a 1-dim array, with the information
about the structure of the array provided by the declaration?
Hopefully this makes sense.

The exercise associated with this, used the construct

*p = arr[1 or 0 ] to point to either the "first" or "second" row of
the array. Does the compiler "know" where to point to because it has
been given this information by the declaration of "13" in arr[2][13].
Hopefully this makes sense too!
Show full article (1.18Kb)
31 Comments
  realloc problem, corrupt last item         


Author: Igal
Date: May 8, 2008 07:15

hay, i have this werid problem with my book adding function, this how
it looks

book* AddBook(book *bp, unsigned *size) {
...
//then i use realloc to allocate space for the new item in the bp
pointer
bp = (book*)realloc(bp, sizeof(book));
...
}

when i do this, the next them is added in this right space. but let's
say *bp hold 2 book type items, first item will be ok, second one will
get garbage content, then the third item (the new reallocated one)
will get the new data.
i just have no idea will the last item gets corruped, this also
happens with more items in array.

i know that to use linked lists is a lot better solution, but i still
dunno how to use them right just yet.
15 Comments
  MONEY MAKER         


Author: ruby
Date: May 8, 2008 06:25

HELLO FRIEND,

DO U HAVE A BLOG? I WILL SHOW YOU
HOW TO MAKE MONEY FROM IT 100%% FREE.

TO LOOK AT THE BELOW WEBSITE.

www.bigconcern3.blogspot.com
no comments
  Compile error         


Author: iavian
Date: May 8, 2008 05:54

I am trying to compile a code that includes header from both oracle
and postgres

/usr/local/pgsql/include/server/c.h:420: error: conflicting
declaration 'typedef struct varlena text'
/opt/oracle/product/10.2.0/rdbms/public/oratypes.h:196: error: 'text'
has a previous declaration as `typedef oratext text'

How do i fix this ?
1 Comment
  video!!         


Author: tobiaszwawrzyniak
Date: May 8, 2008 05:39

no comments
  Re: indentation         


Author: Eligiusz Narutowicz
Date: May 8, 2008 04:35

"Bill Cunningham" nspam.com> writes:
Show full article (0.69Kb)
no comments
  Where to learn linked lists (recursive)         


Author:
Date: May 8, 2008 03:25

I need of your advice. A good link where I can learn linked lists with
recursive method (reverse, merge, sort, insertion and so on); well
commented and explained.
1 Comment
 
1 2