/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8; fill-column: 160 -*- */
/* camel-stream.c : abstract class for a stream */

/*
 * Author:
 *  Michael Zucchi <notzed@ximian.com>
 *
 * Copyright 1999, 2000 Ximian, Inc. (www.ximian.com)
 *
 * This program is free 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 2 of the
 * License, or (at your option) any later version.
 *
 * 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
 */

#ifdef HAVE_CONFIG_H
#include <config.h>
#endif

#include "camel-stream-null.h"

static CamelObjectClass *parent_class = NULL;

/* Returns the class for a CamelStream */
#define CS_CLASS(so) CAMEL_STREAM_NULL_CLASS(CAMEL_OBJECT_GET_CLASS(so))

/* dummy implementations, for a NULL stream */
static ssize_t   stream_read       (CamelStream *stream, char *buffer, size_t n) { return 0; }
static ssize_t   stream_write      (CamelStream *stream, const char *buffer, size_t n) { ((CamelStreamNull *)stream)->written += n; return n; }
static int       stream_close      (CamelStream *stream) { return 0; }
static int       stream_flush      (CamelStream *stream) { return 0; }
static gboolean  stream_eos        (CamelStream *stream) { return TRUE; }
static int       stream_reset      (CamelStream *stream) { ((CamelStreamNull *)stream)->written = 0; return 0; }

static void
camel_stream_null_class_init (CamelStreamClass *camel_stream_null_class)
{
	CamelStreamClass *camel_stream_class = (CamelStreamClass *)camel_stream_null_class;

	parent_class = camel_type_get_global_classfuncs( CAMEL_OBJECT_TYPE );

	/* virtual method definition */
	camel_stream_class->read = stream_read;
	camel_stream_class->write = stream_write;
	camel_stream_class->close = stream_close;
	camel_stream_class->flush = stream_flush;
	camel_stream_class->eos = stream_eos;
	camel_stream_class->reset = stream_reset;
}

CamelType
camel_stream_null_get_type (void)
{
	static CamelType camel_stream_null_type = CAMEL_INVALID_TYPE;

	if (camel_stream_null_type == CAMEL_INVALID_TYPE) {
		camel_stream_null_type = camel_type_register( camel_stream_get_type(),
							      "CamelStreamNull",
							      sizeof( CamelStreamNull ),
							      sizeof( CamelStreamNullClass ),
							      (CamelObjectClassInitFunc) camel_stream_null_class_init,
							      NULL,
							      NULL,
							      NULL );
	}

	return camel_stream_null_type;
}

/**
 * camel_stream_null_new:
 *
 * Returns a NULL stream.  A null stream is always at eof, and
 * always returns success for all reads and writes.
 *
 * Return value: the stream
 **/
CamelStream *
camel_stream_null_new(void)
{
	return (CamelStream *)camel_object_new(camel_stream_null_get_type ());
}
ectron6/files/elliptic-6.5.3</option>
<option value='dependabot/npm_and_yarn/devel/electron6/files/elliptic-6.5.4'>dependabot/npm_and_yarn/devel/electron6/files/elliptic-6.5.4</option>
<option value='dependabot/npm_and_yarn/devel/electron6/files/ini-1.3.8'>dependabot/npm_and_yarn/devel/electron6/files/ini-1.3.8</option>
<option value='dependabot/npm_and_yarn/devel/electron6/files/lodash-4.17.19'>dependabot/npm_and_yarn/devel/electron6/files/lodash-4.17.19</option>
<option value='dependabot/npm_and_yarn/devel/electron6/files/lodash.merge-4.6.2'>dependabot/npm_and_yarn/devel/electron6/files/lodash.merge-4.6.2</option>
<option value='dependabot/npm_and_yarn/devel/electron6/files/node-fetch-2.6.1'>dependabot/npm_and_yarn/devel/electron6/files/node-fetch-2.6.1</option>
<option value='dependabot/npm_and_yarn/devel/electron6/files/serve-10.1.2'>dependabot/npm_and_yarn/devel/electron6/files/serve-10.1.2</option>
<option value='gnome-3.22'>gnome-3.22</option>
<option value='gnome-3.24'>gnome-3.24</option>
<option value='gnome-3.26'>gnome-3.26</option>
<option value='gnome-3.28' selected='selected'>gnome-3.28</option>
<option value='gnome-3.32'>gnome-3.32</option>
<option value='gnome-3.36'>gnome-3.36</option>
<option value='gstreamer'>gstreamer</option>
<option value='gstreamer-1.16'>gstreamer-1.16</option>
<option value='gstreamer0.10-removal'>gstreamer0.10-removal</option>
<option value='main'>main</option>
<option value='master'>master</option>
<option value='mate-1.16'>mate-1.16</option>
<option value='mate-1.18'>mate-1.18</option>
<option value='mate-1.20'>mate-1.20</option>
<option value='mate-1.22'>mate-1.22</option>
</select> <input type='submit' value='switch'/></form></td></tr>
<tr><td class='sub'>FreeBSD GNOME current development ports (https://github.com/freebsd/freebsd-ports-gnome)</td><td class='sub right'></td></tr></table>
<table class='tabs'><tr><td>
<a href='/~lantw44/cgit/cgit.cgi/freebsd-ports-gnome/about/?h=gnome-3.28'>about</a><a href='/~lantw44/cgit/cgit.cgi/freebsd-ports-gnome/?h=gnome-3.28'>summary</a><a href='/~lantw44/cgit/cgit.cgi/freebsd-ports-gnome/refs/?h=gnome-3.28&amp;id=e0cd3420489573ca501c588fae760fa3739e168c'>refs</a><a class='active' href='/~lantw44/cgit/cgit.cgi/freebsd-ports-gnome/log/security/p5-Crypt-Rabbit?h=gnome-3.28'>log</a><a href='/~lantw44/cgit/cgit.cgi/freebsd-ports-gnome/tree/security/p5-Crypt-Rabbit?h=gnome-3.28&amp;id=e0cd3420489573ca501c588fae760fa3739e168c'>tree</a><a href='/~lantw44/cgit/cgit.cgi/freebsd-ports-gnome/commit/security/p5-Crypt-Rabbit?h=gnome-3.28&amp;id=e0cd3420489573ca501c588fae760fa3739e168c'>commit</a><a href='/~lantw44/cgit/cgit.cgi/freebsd-ports-gnome/diff/security/p5-Crypt-Rabbit?h=gnome-3.28&amp;id=e0cd3420489573ca501c588fae760fa3739e168c'>diff</a><a href='/~lantw44/cgit/cgit.cgi/freebsd-ports-gnome/stats/security/p5-Crypt-Rabbit?h=gnome-3.28'>stats</a></td><td class='form'><form class='right' method='get' action='/~lantw44/cgit/cgit.cgi/freebsd-ports-gnome/log/security/p5-Crypt-Rabbit'>
<input type='hidden' name='h' value='gnome-3.28'/><input type='hidden' name='id' value='e0cd3420489573ca501c588fae760fa3739e168c'/><select name='qt'>
<option value='grep'>log msg</option>
<option value='author'>author</option>
<option value='committer'>committer</option>
<option value='range'>range</option>
</select>
<input class='txt' type='search' size='10' name='q' value=''/>
<input type='submit' value='search'/>
</form>
</td></tr></table>
<div class='path'>path: <a href='/~lantw44/cgit/cgit.cgi/freebsd-ports-gnome/log/?h=gnome-3.28&amp;id=e0cd3420489573ca501c588fae760fa3739e168c'>root</a>/<a href='/~lantw44/cgit/cgit.cgi/freebsd-ports-gnome/log/security?h=gnome-3.28&amp;id=e0cd3420489573ca501c588fae760fa3739e168c'>security</a>/<a href='/~lantw44/cgit/cgit.cgi/freebsd-ports-gnome/log/security/p5-Crypt-Rabbit?h=gnome-3.28&amp;id=e0cd3420489573ca501c588fae760fa3739e168c'>p5-Crypt-Rabbit</a></div><div class='content'><table class='list nowrap'><tr class='nohover'><th></th><th class='left'>Commit message (<a href='/~lantw44/cgit/cgit.cgi/freebsd-ports-gnome/log/security/p5-Crypt-Rabbit?h=gnome-3.28&amp;id=e0cd3420489573ca501c588fae760fa3739e168c&amp;showmsg=1'>Expand</a>)</th><th class='left'>Author</th><th class='left'>Age</th><th class='left'>Files</th><th class='left'>Lines</th></tr>
<tr><td class='commitgraph'>* </td><td><a href='/~lantw44/cgit/cgit.cgi/freebsd-ports-gnome/commit/security/p5-Crypt-Rabbit?h=gnome-3.28&amp;id=9debac461b7729b783ca5a0f5e46461ddac07173'>Change the way Perl modules are installed, update the default Perl to 5.18.</a></td><td>mat</td><td><span title='2014-11-26 21:08:24 +0800'>2014-11-26</span></td><td>2</td><td><span class='deletions'>-6</span>/<span class='insertions'>+3</span></td></tr>
<tr><td class='commitgraph'>* </td><td><a href='/~lantw44/cgit/cgit.cgi/freebsd-ports-gnome/commit/security/p5-Crypt-Rabbit?h=gnome-3.28&amp;id=d4ba2ee310de35fc89a3aa0df9bd3994df0e1c06'>Remove all the bootstrap files (.bs) from the plists.</a></td><td>mat</td><td><span title='2014-06-10 20:14:12 +0800'>2014-06-10</span></td><td>1</td><td><span class='deletions'>-1</span>/<span class='insertions'>+0</span></td></tr>
<tr><td class='commitgraph'>* </td><td><a href='/~lantw44/cgit/cgit.cgi/freebsd-ports-gnome/commit/security/p5-Crypt-Rabbit?h=gnome-3.28&amp;id=a22c5dd5d341ec48061d6ece83cc6efc8380bfb5'>Instead of hardcoding the flags passed to OPTIMIZE, replace it</a></td><td>skreuzer</td><td><span title='2014-04-11 23:14:27 +0800'>2014-04-11</span></td><td>2</td><td><span class='deletions'>-10</span>/<span class='insertions'>+3</span></td></tr>
<tr><td class='commitgraph'>* </td><td><a href='/~lantw44/cgit/cgit.cgi/freebsd-ports-gnome/commit/security/p5-Crypt-Rabbit?h=gnome-3.28&amp;id=b6efd083ab5466410a3b1d0cc418fb2bf9a3a335'>Fix build on versions of FreeBSD that don't have gcc as the default</a></td><td>skreuzer</td><td><span title='2014-04-04 23:11:43 +0800'>2014-04-04</span>