This problem exists long time in PSPad. Seems that editor counts opening and
closing brackets ignoring #ifdef, #else, #endif directives. So it founds two
opening brackets "{" and only one closing bracket "}" and seems this confuses
code explorer.
As workaround I am trying to move opening bracket after #endif. So modified your
example is shown correctly in code explorer:
static int tdb_oob(TDB_CONTEXT *tdb, tdb_off len, int probe)
{
struct stat st;
if (len <= tdb->map_size)
return 0;
return 0;
}
static int tdb_write(TDB_CONTEXT *tdb, tdb_off off, void *buf, tdb_len len)
{
if (tdb->map_ptr)
memcpy(off + (char *)tdb->map_ptr, buf, len);
#ifdef HAVE_PWRITE
_else if (pwrite(tdb->fd, buf, len, off) != (ssize_t)len)_
#else
else if (lseek(tdb->fd, off, SEEK_SET) != off
_|| write(tdb->fd, buf, len) != (ssize_t)len)_
#endif
_{_
return TDB_ERRCODE(TDB_ERR_IO, -1);
}
return 0;
}
static int tdb_read(TDB_CONTEXT *tdb,tdb_off off,void *buf,tdb_len len,int cv)
{
if (tdb->map_ptr)
memcpy(buf, off + (char *)tdb->map_ptr, len);
#ifdef HAVE_PREAD
_else if (pread(tdb->fd, buf, len, off) != (ssize_t)len)_
#else
else if (lseek(tdb->fd, off, SEEK_SET) != off
_|| read(tdb->fd, buf, len) != (ssize_t)len) _
#endif
_{_
return TDB_ERRCODE(TDB_ERR_IO, -1);
}
return 0;
}
static char *tdb_alloc_read(TDB_CONTEXT *tdb, tdb_off offset, tdb_len len)
{
char *buf;
return buf;
}
--
<http://forum.pspad.com/read.php?4,42192,42196>
PSPad freeware editor http://www.pspad.com