projects
/
citadel.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
0896a2a
)
style
author
Art Cancro
<ajc@uncensored.citadel.org>
Mon, 2 Jul 2012 20:42:00 +0000
(16:42 -0400)
committer
Art Cancro
<ajc@uncensored.citadel.org>
Mon, 2 Jul 2012 20:42:00 +0000
(16:42 -0400)
citadel/room_ops.c
patch
|
blob
|
history
diff --git
a/citadel/room_ops.c
b/citadel/room_ops.c
index aee5c05a17df601952f5edeab7e4eb40ff4c8b0d..13ed6ef610ffaaff2eef16f6e965382b7e032b30 100644
(file)
--- a/
citadel/room_ops.c
+++ b/
citadel/room_ops.c
@@
-1,21
+1,15
@@
/*
* Server functions which perform operations on room objects.
*
/*
* Server functions which perform operations on room objects.
*
- * Copyright (c) 1987-201
1
by the citadel.org team
+ * Copyright (c) 1987-201
2
by the citadel.org team
*
* This program is open source software; you can redistribute it and/or modify
*
* This program is open source software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or
- * (at your option) any later version.
+ * it under the terms of the GNU General Public License, version 3.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "sysdep.h"
*/
#include "sysdep.h"
@@
-261,6
+255,7
@@
SKIP_EVERYTHING:
if (view != NULL) *view = vbuf.v_view;
}
if (view != NULL) *view = vbuf.v_view;
}
+
/*
* Self-checking stuff for a room record read into memory
*/
/*
* Self-checking stuff for a room record read into memory
*/
@@
-362,13
+357,10
@@
void b_putroom(struct ctdlroom *qrbuf, char *room_name)
len = bptr - lowercase_name;
if (qrbuf == NULL) {
len = bptr - lowercase_name;
if (qrbuf == NULL) {
- cdb_delete(CDB_ROOMS,
- lowercase_name, len);
+ cdb_delete(CDB_ROOMS, lowercase_name, len);
} else {
time(&qrbuf->QRmtime);
} else {
time(&qrbuf->QRmtime);
- cdb_store(CDB_ROOMS,
- lowercase_name, len,
- qrbuf, sizeof(struct ctdlroom));
+ cdb_store(CDB_ROOMS, lowercase_name, len, qrbuf, sizeof(struct ctdlroom));
}
}
}
}
@@
-389,7
+381,6
@@
void b_deleteroom(char *room_name) {
}
}
-
/*
* CtdlPutRoomLock() - same as CtdlPutRoom() but unlocks the record (if supported)
*/
/*
* CtdlPutRoomLock() - same as CtdlPutRoom() but unlocks the record (if supported)
*/
@@
-401,8
+392,6
@@
void CtdlPutRoomLock(struct ctdlroom *qrbuf)
}
}
-/****************************************************************************/
-
/*
* CtdlGetFloorByName() - retrieve the number of the named floor
/*
* CtdlGetFloorByName() - retrieve the number of the named floor
@@
-426,7
+415,6
@@
int CtdlGetFloorByName(const char *floor_name)
}
}
-
/*
* CtdlGetFloorByNameLock() - retrieve floor number for given floor and lock the floor list.
*/
/*
* CtdlGetFloorByNameLock() - retrieve floor number for given floor and lock the floor list.
*/
@@
-484,6
+472,7
@@
void CtdlGetFloor(struct floor *flbuf, int floor_num)
}
}
+
/*
* lgetfloor() - same as CtdlGetFloor() but locks the record (if supported)
*/
/*
* lgetfloor() - same as CtdlGetFloor() but locks the record (if supported)
*/
@@
-533,7
+522,6
@@
struct floor *CtdlGetCachedFloor(int floor_num) {
}
}
-
/*
* CtdlPutFloor() - store floor data on disk
*/
/*
* CtdlPutFloor() - store floor data on disk
*/
@@
-553,7
+541,6
@@
void CtdlPutFloor(struct floor *flbuf, int floor_num)
}
}
-
/*
* CtdlPutFloorLock() - same as CtdlPutFloor() but unlocks the record (if supported)
*/
/*
* CtdlPutFloorLock() - same as CtdlPutFloor() but unlocks the record (if supported)
*/
@@
-566,7
+553,6
@@
void CtdlPutFloorLock(struct floor *flbuf, int floor_num)
}
}
-
/*
* lputfloor() - same as CtdlPutFloor() but unlocks the record (if supported)
*/
/*
* lputfloor() - same as CtdlPutFloor() but unlocks the record (if supported)
*/
@@
-591,11
+577,13
@@
void CtdlForEachRoom(void (*CallBack) (struct ctdlroom *EachRoom, void *out_data
memset(&qrbuf, 0, sizeof(struct ctdlroom));
memcpy(&qrbuf, cdbqr->ptr,
((cdbqr->len > sizeof(struct ctdlroom)) ?
memset(&qrbuf, 0, sizeof(struct ctdlroom));
memcpy(&qrbuf, cdbqr->ptr,
((cdbqr->len > sizeof(struct ctdlroom)) ?
- sizeof(struct ctdlroom) : cdbqr->len));
+ sizeof(struct ctdlroom) : cdbqr->len)
+ );
cdb_free(cdbqr);
room_sanity_check(&qrbuf);
cdb_free(cdbqr);
room_sanity_check(&qrbuf);
- if (qrbuf.QRflags & QR_INUSE)
+ if (qrbuf.QRflags & QR_INUSE)
{
(*CallBack)(&qrbuf, in_data);
(*CallBack)(&qrbuf, in_data);
+ }
}
}
}
}
@@
-608,7
+596,7
@@
void delete_msglist(struct ctdlroom *whichroom)
struct cdbdata *cdbml;
/* Make sure the msglist we're deleting actually exists, otherwise
struct cdbdata *cdbml;
/* Make sure the msglist we're deleting actually exists, otherwise
- *
gdbm
will complain when we try to delete an invalid record
+ *
libdb
will complain when we try to delete an invalid record
*/
cdbml = cdb_fetch(CDB_MSGLISTS, &whichroom->QRnumber, sizeof(long));
if (cdbml != NULL) {
*/
cdbml = cdb_fetch(CDB_MSGLISTS, &whichroom->QRnumber, sizeof(long));
if (cdbml != NULL) {
@@
-620,7
+608,6
@@
void delete_msglist(struct ctdlroom *whichroom)
}
}
-
/*
* Message pointer compare function for sort_msglist()
*/
/*
* Message pointer compare function for sort_msglist()
*/
@@
-649,8
+636,7
@@
int sort_msglist(long listptrs[], int oldcount)
/* and yank any nulls */
while ((numitems > 0) && (listptrs[0] == 0L)) {
/* and yank any nulls */
while ((numitems > 0) && (listptrs[0] == 0L)) {
- memmove(&listptrs[0], &listptrs[1],
- (sizeof(long) * (numitems - 1)));
+ memmove(&listptrs[0], &listptrs[1], (sizeof(long) * (numitems - 1)));
--numitems;
}
--numitems;
}
@@
-674,7
+660,6
@@
int CtdlIsNonEditable(struct ctdlroom *qrbuf)
}
}
-
/*
* Back-back-end for all room listing commands
*/
/*
* Back-back-end for all room listing commands
*/