fi
done <$t
rm $t
-fi
+fi
exec >&2
mutt -x -e 'set charset="utf-8"; set send_charset="us-ascii:iso-8859-2:utf-8"' -s "$subj" "$recipient" <$out
/*
- * Sherlock Library -- Character Conversion with Allocation on a Memory Pool
+ * Sherlock Library -- Character Conversion with Allocation on a Memory Pool
*
* (c) 2006 Pavel Charvat <pchar@ucw.cz>
*
{
if (in_cs == out_cs)
return mp_strdup(mp, s);
-
+
struct conv_context c;
char *b[32];
uns bs[32], n = 0, sum = 0;
uns l = strlen(s) + 1;
-
+
conv_init(&c);
conv_set_charset(&c, in_cs, out_cs);
c.source = s;
/*
- * Sherlock Library -- Character Conversion with Allocation on a Memory Pool
+ * Sherlock Library -- Character Conversion with Allocation on a Memory Pool
*
* (c) 2006 Pavel Charvat <pchar@ucw.cz>
*
byte *mp_strconv(struct mempool *mp, byte *s, uns cs_in, uns cs_out);
static inline byte *
-mp_strconv_to_utf8(struct mempool *mp, byte *s, uns cs_in)
+mp_strconv_to_utf8(struct mempool *mp, byte *s, uns cs_in)
{ return mp_strconv(mp, s, cs_in, CONV_CHARSET_UTF8); }
static inline byte *
/*
- * Sherlock Library -- Character Conversion with Allocation on the Stack
+ * Sherlock Library -- Character Conversion with Allocation on the Stack
*
* (c) 2006 Pavel Charvat <pchar@ucw.cz>
*
/*
- * Sherlock Library -- Character Conversion with Allocation on the Stack
+ * Sherlock Library -- Character Conversion with Allocation on the Stack
*
* (c) 2006 Pavel Charvat <pchar@ucw.cz>
*
#define stk_strconv_to_utf8(s, cs_in) stk_strconv(s, cs_in, CONV_CHARSET_UTF8)
#define stk_strconv_from_utf8(s, cs_out) stk_strconv(s, CONV_CHARSET_UTF8, cs_out)
-
+
/* Internals */
uns stk_strconv_init(struct conv_context *c, byte *s, uns cs_in, uns cs_out);
check();
generate();
init_timer();
- as_sort(N);
+ as_sort(N);
printf("asort: %d ms\n", get_timer());
check();
return 0;
headache. - Turadg Aleahmad <turadg@wise.berkeley.edu>
*/
- if (ch == ' ') ch = '+';
+ if (ch == ' ') ch = '+';
ch = reverse_table[ch];
if (ch == 0xff) continue;
uns a, i;
byte *bytes;
a = ~x & (x - sub) & and;
- /*
+ /*
* x_2 = x - 0x01010101;
* x_3 = ~x & x_2;
* a = x_3 & 0x80808080;
GLUE_(h_px,node) *h_var = &h_buck->n;
#define HASH_FOR_ALL(h_px, h_var) HASH_FOR_ALL_DYNAMIC(h_px, &GLUE_(h_px,table), h_var)
#define HASH_END_FOR } } while(0)
-#define HASH_BREAK
+#define HASH_BREAK
#define HASH_CONTINUE continue
#endif
* Each time you include it with parameters set in the corresponding
* preprocessor macros, it generates KMP structures and functions
* with the parameters given. See lib/kmp.h before reading this description.
- *
+ *
* This file defines:
*
* struct search structure with both the internal and the user-defined variables
* used during the search and accessible from all macros
*
* void search(kmp,search,src) executes the search; search structure is allocated by the caller (possible input/output)
- *
+ *
* void run(kmp,src) the same, but automatically allocates search structre from the stack
*
*
*
* KMPS_INIT(kmp,src,search) statement executed at the beginning of search()
* KMPS_EXIT(kmp,src,search) ... at the end
- * KMPS_STEP(kmp,src,search) ... after each step (read of next character + current state update)
+ * KMPS_STEP(kmp,src,search) ... after each step (read of next character + current state update)
* of the algorithm, but before KMPS_FOUND[_CHAIN]
- * KMPS_FOUND_CHAIN(kmp,src,search) ... for each state representing locally longest match
+ * KMPS_FOUND_CHAIN(kmp,src,search) ... for each state representing locally longest match
* (stored in search->out - NOT necessary search->s!);
- * all matches form a NULL-terminated link list (search->out, search->out->next, ...)
+ * all matches form a NULL-terminated link list (search->out, search->out->next, ...)
* in order of decreasing length
* KMPS_FOUND(kmp,src,search) ... called for every match (in search->out)
* KMPS_WANT_BEST algorithm computes globally longest match, which is available
* we abbreviate this to P(x) below
*
* KMP_CHAR alphabet type, the default is u16
- *
- * KMP_SOURCE user-defined text source; KMP_GET_CHAR must
+ *
+ * KMP_SOURCE user-defined text source; KMP_GET_CHAR must
* KMP_GET_CHAR(kmp,src,c) return zero at the end or nonzero together with the next character in c otherwise;
* if not defined, zero-terminated array of bytes is used as the input
- *
+ *
* KMP_VARS user-defined variables in 'struct P(struct)'
* -- a structure describing the whole automaton;
* these variables are stored in .u substructure to avoid collisions
struct {
# ifdef KMP_STATE_VARS
KMP_STATE_VARS
-# endif
+# endif
} u; /* user-defined data*/
};
P(hash_init_key) (struct P(hash_table) *t UNUSED, struct P(state) *s, struct P(state) *f, P(char_t) c)
{
bzero(s, sizeof(*s));
-# ifdef KMP_INIT_STATE
+# ifdef KMP_INIT_STATE
struct P(struct) *kmp = (struct P(struct) *)t;
{ KMP_INIT_STATE(kmp, s); }
-# endif
+# endif
s->from = f;
s->c = c;
s->next = f->back; /* the pointers hold the link-list of sons... changed in build() */
else if (!Ualpha(cc))
cc = P(control)();
else
-# endif
+# endif
{
# ifdef KMP_TOLOWER
cc = Utolower(cc);
null->back = NULL;
# ifdef KMP_BUILD_STATE
{ KMP_BUILD_STATE(kmp, null); }
-# endif
+# endif
while (read != write)
{
struct P(state) *s = fifo[read++], *t;
}
# ifdef KMP_BUILD_STATE
{ KMP_BUILD_STATE(kmp, s); }
-# endif
+# endif
}
}
* null head_node.prev tail_node.next
* tail tail_node.prev
*/
-
+
typedef struct node {
struct node *next, *prev;
} node;
* This software may be freely distributed and used according to the terms
* of the GNU Lesser General Public License.
*
- * The file format is based on LZO1X and
+ * The file format is based on LZO1X and
* the compression method is based on zlib.
*/
C following characters will be copied from the compressed text to the
output. The number CC is always stored in the 2 least significant bits of
the second last byte of the sequence.
-
+
If END is read, the algorithm switches to the copy mode.
pattern length position
}
/*
- * Final wrapup - pad to 64-byte boundary with the bit pattern
+ * Final wrapup - pad to 64-byte boundary with the bit pattern
* 1 0* (64-bit count of bits processed, MSB-first)
*/
void MD5Final(unsigned char digest[16], struct MD5Context *ctx)
# Interface:
# Sherlock::Ulimit::setlimit( $resource, $softlimit, $hardlimit)
# Sherlock::Ulimit::getlimit( $resource, $softlimit, $hardlimit)
-#
+#
# setlimit sets limit to values supplied in softlimit and hardlimit
# getlimit reads limits into softlimit and hardlimit
# $resource constants are defined below
# If you do not need this, moving things directly into @EXPORT or @EXPORT_OK
# will save memory.
our %EXPORT_TAGS = ( 'all' => [ qw(
-
+
) ] );
our @EXPORT_OK = ( @{ $EXPORT_TAGS{'all'} } );
#include <unistd.h>
-MODULE = Sherlock::Ulimit PACKAGE = Sherlock::Ulimit
+MODULE = Sherlock::Ulimit PACKAGE = Sherlock::Ulimit
PROTOTYPES: ENABLED
* A red-black tree is a binary search tree, where records are stored
* in nodes (may be also leaves). Every node has a colour. The
* following restrictions hold:
- *
+ *
* - a parent of a red node is black
* - every path from the root to a node with less than 2 children
* contains the same number of black nodes