"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "dbm_map.c" between
mdocml-1.14.1rc1.tar.gz and mdocml-1.14.1rc2.tar.gz

About: mdocml is a suite of tools compiling "-mdoc", the roff macro package of choice for BSD manual pages, and "-man", the predominant historical package for UNIX manuals. Hint: The installed binary name is "mandoc". Release candidate.

dbm_map.c  (mdocml-1.14.1rc1):dbm_map.c  (mdocml-1.14.1rc2)
/* $Id: dbm_map.c,v 1.7 2016/10/22 10:09:27 schwarze Exp $ */ /* $Id: dbm_map.c,v 1.8 2017/02/17 14:43:54 schwarze Exp $ */
/* /*
* Copyright (c) 2016 Ingo Schwarze <schwarze@openbsd.org> * Copyright (c) 2016 Ingo Schwarze <schwarze@openbsd.org>
* *
* Permission to use, copy, modify, and distribute this software for any * Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above * purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies. * copyright notice and this permission notice appear in all copies.
* *
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
skipping to change at line 178 skipping to change at line 178
/* /*
* The reverse of dbm_get(). * The reverse of dbm_get().
* Take pointer into the database file * Take pointer into the database file
* and convert it to the raw integer * and convert it to the raw integer
* that would be used to refer to that place in the file. * that would be used to refer to that place in the file.
*/ */
int32_t int32_t
dbm_addr(const void *p) dbm_addr(const void *p)
{ {
return htobe32((char *)p - dbm_base); return htobe32((const char *)p - dbm_base);
} }
int int
dbm_match(const struct dbm_match *match, const char *str) dbm_match(const struct dbm_match *match, const char *str)
{ {
switch (match->type) { switch (match->type) {
case DBM_EXACT: case DBM_EXACT:
return strcmp(str, match->str) == 0; return strcmp(str, match->str) == 0;
case DBM_SUB: case DBM_SUB:
return strcasestr(str, match->str) != NULL; return strcasestr(str, match->str) != NULL;
 End of changes. 2 change blocks. 
2 lines changed or deleted 2 lines changed or added

Home  |  About  |  All  |  Newest  |  Fossies Dox  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTPS