Sed question

I have never used sed to search and replace on a pattern that is over multiple lines and am a little confused on how I tell sed to look at the next line, if I can. For example, I am searching for this:

static void c0000_ietexit(void)
{

When that is found I want to add this line.

int processReturnCode = 0;

I just am not sure how to tell the search to look at the next line and then inturn pass that back to the replace.

Use awk, not sed:

awk '
{print}
/^{$/ {
  if ( last == "static void c0000_ietexit(void)" ) print "int processReturnCode = 0;"
}
{last = $0}'


sed "/static void c0000_ietexit(void)/{N;/\n{/s//int processReturnCode = 0;/;}" file

Thank you both, I was able to do what I needed to do with the awk example.