| * JFFS2 -- Journalling Flash File System, Version 2. |
| * Copyright (C) 2001, 2002 Red Hat, Inc. |
| * Created by David Woodhouse <dwmw2@infradead.org> |
| * For licensing information, see the file 'LICENCE' in this directory. |
| * $Id: pushpull.h,v 1.10 2004/11/16 20:36:11 dwmw2 Exp $ |
| static inline void init_pushpull(struct pushpull *pp, char *buf, unsigned buflen, unsigned ofs, unsigned reserve) |
| static inline int pushbit(struct pushpull *pp, int bit, int use_reserved) |
| if (pp->ofs >= pp->buflen - (use_reserved?0:pp->reserve)) { |
| pp->buf[pp->ofs >> 3] |= (1<<(7-(pp->ofs &7))); |
| pp->buf[pp->ofs >> 3] &= ~(1<<(7-(pp->ofs &7))); |
| static inline int pushedbits(struct pushpull *pp) |
| static inline int pullbit(struct pushpull *pp) |
| bit = (pp->buf[pp->ofs >> 3] >> (7-(pp->ofs & 7))) & 1; |
| static inline int pulledbits(struct pushpull *pp) |
| #endif /* __PUSHPULL_H__ */ |