search for: strm

Displaying 20 results from an estimated 38 matches for "strm".

Did you mean: str
2012 May 27
1
Thread Problem.
...ope to be the only relevant code for the music and see if anyone has any suggestions on what I can do to fix this problem. -Note: I can't exactly send all the music code, but if you need to see more let me know. To start it off the main function for the music thread looks like this: void ReadStrmData() { // Switch buffer page char *buf; if(strm.bufPage == 0) { buf = strm_buf; strm.bufPage = 1; } else { buf = strm_buf + /*STRM_BUF_PAGESIZE*/4096; strm.bufPage = 0; } long t...
2012 Aug 20
13
[PATCH 00/12] Multidisk support
Hello, the following patches should get multidisk access working. The syntax accepted is the following: (hdx,y)/path/to/file where x is the disk number and start at 0 and the y is the partition number starting at 1. So (hd0,1) is the first partition of the first disk. the other accepted syntax is using MBR's 32 bits disk signature so for example: (mbr:0x12345678,2)/foo/bar would address
2009 Dec 19
0
[LLVMdev] [PATCH] Implement dbgs()
...namic_cast<llvm::circular_raw_ostream *>(&llvm::dbgs()); Please do not use dynamic_cast, we're trying to eliminate the last RTTI use in the compiler. > +/// dbgs - Return a circular-buffered debug stream. > +raw_ostream &llvm::dbgs() { > + static circular_raw_ostream strm(errs(), DebugBufferSize); > + > + static bool initialized = false; > + if (!initialized) { > + initialized = true; This isn't thread safe. A way to fix this is to do something like: static struct dbgstream { circular_raw_ostream strm; dbgstream() : strm(errs(), DebugB...
2016 Feb 17
0
[PATCH supermin v2 1/4] init: Uncompress modules before adding them to the mini initrd.
...ar *buf = (char *) malloc (capacity); - int tmpsize = 8 * 1024; - char tmp[tmpsize]; - int num; - - errno = 0; - size = 0; - - if (!buf) { - perror("malloc"); - exit (EXIT_FAILURE); - } - -#ifdef HAVE_LZMA_STATIC - if (ends_with(filename, ".xz")) { - lzma_stream strm = LZMA_STREAM_INIT; - lzma_ret ret = lzma_stream_decoder(&strm, UINT64_MAX, - LZMA_CONCATENATED); - if (verbose) - fprintf (stderr, "supermin: running xz\n"); - FILE *fd = fopen (filename, "r"); - if (!fd) { - perror("popen failed");...
2010 Aug 08
2
subset of string by index
How can I get a substring based on the index into the string? strM <- c("abcde", "cdefg") ind <- c(1,3,5) I want to use ind to index into the strings so the result is: strMind <- c("ace", "ceg")
2009 Dec 18
2
[LLVMdev] [PATCH] Implement dbgs()
...the debug type // specified on the command line, or if none was specified on the command line // with the -debug-only=X option. @@ -66,9 +88,29 @@ CurrentDebugType = Type; } +/// dbgs - Return a circular-buffered debug stream. +raw_ostream &llvm::dbgs() { + static circular_raw_ostream strm(errs(), DebugBufferSize); + + static bool initialized = false; + if (!initialized) { + initialized = true; + + sys::AddSignalHandler(&debug_user_sig_handler, 0); + // TODO: Add a handler for SIGUSER1-type signals so the user can + // force a debug dump. + } + + return strm; +}...
2016 Feb 17
2
[PATCH supermin 0/2] Allow an alternate libc to be used for init.
Allow an alternate libc, such as dietlibc, to be used for the init binary in the supermin appliance. Rich.
2020 Jul 10
2
[PATCH nbdkit] New filter: gzip
...pass readonly=1 to the underlying plugin. */ + if (next (nxdata, 1) == -1) + return NULL; + + return NBDKIT_HANDLE_NOT_NEEDED; +} + +/* Convert a zlib error (always negative) to an nbdkit error message, + * and return errno correctly. + */ +static void +zerror (const char *op, const z_stream *strm, int zerr) +{ + if (zerr == Z_MEM_ERROR) { + errno = ENOMEM; + nbdkit_error ("gzip: %s: %m", op); + } + else { + errno = EIO; + if (strm->msg) + nbdkit_error ("gzip: %s: %s", op, strm->msg); + else + nbdkit_error ("gzip: %s: unknown error:...
2018 Nov 21
3
[PATCH nbdkit v2 0/3] Rewrite xz plugin as a filter.
v2: - Fixes a number of bugs in corner cases. - Uses a 1M block size to fetch from the underlying plugin. This improves performance considerably. I also tested this much more thoroughly and can't find any more bugs. Rich.
2002 Jan 30
1
Patch: update zlib/* to 1.1.3
...; /* The application can compare zlibVersion and ZLIB_VERSION for consistency. If the first character differs, the library code actually used is not compatible with the zlib.h header file used by the application. @@ -177,7 +177,7 @@ */ /* -extern int ZEXPORT deflateInit OF((z_streamp strm, int level)); +ZEXTERN int ZEXPORT deflateInit OF((z_streamp strm, int level)); Initializes the internal stream state for compression. The fields zalloc, zfree and opaque must be initialized before by the caller. @@ -199,7 +199,7 @@ */ -extern int ZEXPORT deflate OF((z_streamp strm...
2013 Aug 19
5
[PATCH v2 0/3 supermin] URPMI & xz support.
Joseph, Please try my modified versions of these patches. These are compile-tested on Fedora and they don't break any existing functionality, but I don't have either urpmi nor a statically-linked xz so I cannot fully test them. I have also fixed detection of zlib (2/3). Rich.
2018 Nov 21
5
[PATCH nbdkit 0/2] Rewrite xz plugin as a filter.
Matt asked if xz should really be a filter rather than a plugin. The answer is yes, of course it should be! That's been something in the todo file for a while. The commit converts the xz plugin code into a filter (leaving the plugin around, but deprecating it). plugin: nbdkit xz file.xz filter: nbdkit --filter=xz file file.xz plugin: # can't be done filter: nbdkit
2009 Dec 19
3
[LLVMdev] [PATCH] Implement dbgs()
...l handler is invoked it will really be a circular_raw_ostream since the handler should (!) only be set up in debug mode. That scares me a bit, though. > > +/// dbgs - Return a circular-buffered debug stream. > > +raw_ostream &llvm::dbgs() { > > + static circular_raw_ostream strm(errs(), DebugBufferSize); > > + > > + static bool initialized = false; > > + if (!initialized) { > > + initialized = true; > > This isn't thread safe. A way to fix this is to do something like: > > static struct dbgstream { > circular_raw_ostream...
2016 Feb 17
8
[PATCH supermin 0/2] Allow an alternate libc to be used for init.
v1 -> v2: - If we split out the init program into a separate init/ directory, that makes it much easier to build against an alternate libc. I tried to build against uClibc, but uClibc requires an entire build chain, which looked like it was going to be a massive ballache. Rich.
2009 Dec 21
2
[LLVMdev] [PATCH] Implement dbgs()
...he command line // with the -debug-only=X option. @@ -66,9 +91,29 @@ CurrentDebugType = Type; } +/// dbgs - Return a circular-buffered debug stream. +raw_ostream &llvm::dbgs() { + // Do one-time initialization in a thread-safe way. + static struct dbgstream { + circular_raw_ostream strm; + + dbgstream() : strm(errs(), DebugBufferSize) { + sys::AddSignalHandler(&debug_user_sig_handler, 0); + // TODO: Add a handler for SIGUSER1-type signals so the user can + // force a debug dump. + } + } thestrm; + + return thestrm.strm; +} + #else // Avoid "has no...
2014 Jul 29
4
[PATCH 0/2] supermin: improve handling of memory
Hi, the two patches improve the way memory is handled in supermin, by cleanly exiting on memory allocation failures, and free'ing memory when not needed (to keep working and not run out of memory). Pino Toscano (2): Check for failures in memory allocations Free memory buffers when not used src/ext2fs-c.c | 13 +++++++++++-- src/init.c | 13 +++++++++++++ 2 files changed, 24
2004 Jan 23
2
chan h323 Compile problem
...rse error before `const' /usr/src/pwlib/include/ptlib/args.h:165: parse error before `int' /usr/src/pwlib/include/ptlib/args.h:175: parse error before `int' /usr/src/pwlib/include/ptlib/args.h:190: `ostream' was not declared in this scope /usr/src/pwlib/include/ptlib/args.h:191: `strm' was not declared in this scope /usr/src/pwlib/include/ptlib/args.h:191: virtual outside class declaration /usr/src/pwlib/include/ptlib/args.h:191: variable or field `PrintOn' declared void /usr/src/pwlib/include/ptlib/args.h:197: `istream' was not declared in this scope /usr/sr...
2009 Dec 19
0
[LLVMdev] [PATCH] Implement dbgs()
On Dec 18, 2009, at 6:36 PM, David Greene wrote: >>> +// Signal handlers - dump debug output on termination. >>> +static void debug_user_sig_handler(void *Cookie) >>> +{ >>> + llvm::circular_raw_ostream *logout = >>> + dynamic_cast<llvm::circular_raw_ostream *>(&llvm::dbgs()); >> >> Please do not use dynamic_cast, we're
2009 Dec 21
0
[LLVMdev] [PATCH] Implement dbgs()
On 2009-12-21 18:06, David Greene wrote: > On Saturday 19 December 2009 00:16, Chris Lattner wrote: > > >>> Or I think I can just assume (Yikes!) that if the signal handler is >>> invoked it will really be a circular_raw_ostream since the handler >>> should (!) only be set up in debug mode. >>> >>> That scares me a bit, though. >>>
2009 Dec 21
2
[LLVMdev] [PATCH] Implement dbgs()
...ebugBuffering - Turn off signal handler installation. +/// +bool llvm::DisableDebugBuffering = false; + +/// dbgs - Return a circular-buffered debug stream. +raw_ostream &llvm::dbgs() { + // Do one-time initialization in a thread-safe way. + static struct dbgstream { + circular_raw_ostream strm; + + dbgstream() : + strm(errs(), + (DisableDebugBuffering || !DebugFlag) ? 0 : DebugBufferSize) { + if (!DisableDebugBuffering && DebugFlag && DebugBufferSize != 0) + // TODO: Add a handler for SIGUSER1-type signals so the user can + // forc...