Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
ccan
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
mirror
ccan
Commits
ee7d1a1c
Commit
ee7d1a1c
authored
Mar 30, 2009
by
Rusty Russell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Joey's array module.
parent
a3d9f540
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
398 additions
and
0 deletions
+398
-0
ccan/array/_info.c
ccan/array/_info.c
+52
-0
ccan/array/array.h
ccan/array/array.h
+69
-0
ccan/array/test/lotsOfNumbers.h
ccan/array/test/lotsOfNumbers.h
+252
-0
ccan/array/test/run.c
ccan/array/test/run.c
+25
-0
No files found.
ccan/array/_info.c
0 → 100644
View file @
ee7d1a1c
#include <string.h>
#include "config.h"
/**
* array - A collection of macros for generic dynamic array management.
*
* The array module provides generic dynamic array functions via macros. It
* removes the tedium of managing realloc'd arrays with pointer, size, and
* allocated size. It also fits into structures quite well.
*
* NOTE: The API is currently unstable. It will likely change in the near future.
*
* Example:
* #include <ccan/array/array.h>
* #include <stdio.h>
*
* int main(void) {
* Array(int) numbers = NewArray();
* char buffer[32];
* int add;
*
* for (;;) {
* AFor(i, numbers, printf("%d ", *i))
* if (numbers.size) puts("");
*
* printf("array> ");
* fgets(buffer, sizeof(buffer), stdin);
* if (*buffer==0 || *buffer=='\n')
* break;
* add = atoi(buffer);
*
* AAppend(numbers, add);
* }
*
* AFree(numbers);
*
* return 0;
* }
*
* Licence: BSD
*/
int
main
(
int
argc
,
char
*
argv
[])
{
if
(
argc
!=
2
)
return
1
;
if
(
strcmp
(
argv
[
1
],
"depends"
)
==
0
)
/* Nothing. */
return
0
;
return
1
;
}
ccan/array/array.h
0 → 100644
View file @
ee7d1a1c
/*
Copyright (c) 2009 Joseph A. Adams
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
3. The name of the author may not be used to endorse or promote products
derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef CCAN_ARRAY_H
#define CCAN_ARRAY_H
#include <stdlib.h>
#include <string.h>
#include "config.h"
#define Array(type) struct {type *item; size_t size; size_t allocSize;}
#define NewArray() {0,0,0}
#define AInit(array) do {(array).item=0; (array).size=0; (array).allocSize=0;} while(0)
#define AFree(array) do {free((array).item);} while(0)
#define AResize(array, newSize) do {size_t __newSize=(newSize); if (__newSize > (array).allocSize) {(array).allocSize = (__newSize+63)&~63; (array).item = realloc((array).item, (array).allocSize*sizeof(*(array).item));} (array).size = __newSize; } while(0)
#define AResize0(array, newSize) do {size_t __oldSize=(array).size, __newSize=(newSize); if (__newSize <= __oldSize) (array).size = __newSize; else {AResize(array,newSize); memset((array).item+__oldSize,0,(__newSize-__oldSize)*sizeof(*(array).item));} } while(0)
#define ASetAllocSize(array, newAlloc) do {(array).item = realloc((array).item, ((array).allocSize = (newAlloc))*sizeof(*(array).item));} while(0)
#define AFromC(array, c_array) AFromItems(array, c_array, sizeof(c_array)/sizeof(*(c_array)))
#define AFromLit(array, stringLiteral) do {AFromItems(array, stringLiteral, sizeof(stringLiteral)); (array).size--;} while(0)
#define AFromString(array, str) do {const char *__str = (str); AFromItems(array, __str, strlen(__str)+1); (array).size--;} while(0)
#define AFromItems(array, items, count) do {size_t __count = (count); AResize(array, __count); memcpy((array).item, items, __count*sizeof(*(array).item));} while(0)
#define AAppend(array, newItem...) do {AResize(array, (array).size+1); (array).item[(array).size-1] = (newItem);} while(0)
#define AAppendString(array, str) do {const char *__str = (str); AAppendItems(array, __str, strlen(__str)+1); (array).size--;} while(0)
#define AAppendLit(array, stringLiteral) do {AAppendItems(array, stringLiteral, sizeof(stringLiteral)); (array).size--;} while(0)
#define AAppendItems(array, items, count) do {size_t __count = (count); AResize(array, (array).size+__count); memcpy((array).item+(array).size-__count, items, __count*sizeof(*(array).item));} while(0)
#define APrepend(array, newItem...) do {AResize(array, (array).size+1); memmove((array).item+1, (array).item, ((array).size-1)*sizeof(*(array).item)); *(array).item = (newItem);} while(0)
#define APrependItems(array, items, count) do {AResize(array, (array).size+(count)); memmove((array).item+(count), (array).item, ((array).size-(count))*sizeof(*(array).item)); memcpy((array).item, items, (count)*sizeof(*(array).item)); } while(0)
#define APush(array, value...) AAppend(array, value)
#define APop(array) ((array).item[--(array).size])
#if HAVE_STATEMENT_EXPR==1
#define AMakeRoom(array, room) ({size_t newAlloc = (array).size+(room); if ((array).allocSize<newAlloc) (array).item = realloc((array).item, ((array).allocSize=newAlloc)*sizeof(*(array).item)); (array).item+(array).size; })
#endif
#if HAVE_TYPEOF==1
#define APopS(array) ((array).size ? APop(array) : (typeof(*(array).item))0)
#define AAppends(array, items...) do {typeof((*(array).item)) __src[] = {items}; AAppendItems(array, __src, sizeof(__src)/sizeof(*__src));} while(0)
#define APrepends(array, items...) do {typeof((*(array).item)) __src[] = {items}; APrependItems(array, __src, sizeof(__src)/sizeof(*__src));} while(0)
#define AFor(var, array, commands...) {typeof(*(array).item) *var=(void*)(array).item; size_t __d=(array).size; for (;__d--;var++) { commands ;} }
#define ARof(var, array, commands...) {typeof(*(array).item) *var=(void*)(array).item; size_t __i=(array).size; var += __i; while (__i--) { var--; commands ;} }
#endif
typedef
Array
(
char
)
ArrayChar
;
#endif
ccan/array/test/lotsOfNumbers.h
0 → 100644
View file @
ee7d1a1c
long
lotsOfNumbers
[]
=
{
0x3BC1544A
,
0xDED23357
,
0xC7CA2233
,
0x642EB9E8
,
0x79AF03EF
,
0x2BA52B1B
,
0xA1D838D1
,
0x3D658883
,
0xD8559EA3
,
0x47DF11FE
,
0x5A6F486E
,
0x0E522BFD
,
0x80E2FE25
,
0xF2C260AE
,
0x13068792
,
0x66C084B2
,
0x9B9161F5
,
0xC69F1C58
,
0xE01C9F2F
,
0x421FEC70
,
0xC8D8FE72
,
0x97E8BA29
,
0x25A221D1
,
0x03E0AFA1
,
0x7542E923
,
0x5BC83711
,
0xE537C213
,
0x77CD74AF
,
0x5A8DF654
,
0xE05167C9
,
0x4E74FC54
,
0x468935A3
,
0xA2CB5BE5
,
0x6D6EC517
,
0x638327AB
,
0x95C0B00F
,
0x66222D5D
,
0xAD073850
,
0xC8A42217
,
0x3B286F2E
,
0x2F460545
,
0x9F15AC1E
,
0x4AFB0BFA
,
0xDF4ED449
,
0xF69E6FB3
,
0x8BA26583
,
0x7560C6C8
,
0x2BDBC15B
,
0x8DE1EA24
,
0xC50A691D
,
0xC0752AFB
,
0x0E4DC9F8
,
0xCEC08C8F
,
0x110170AB
,
0xD8B9294A
,
0xBEDF0E6A
,
0x6467AFB6
,
0xEA7F34CF
,
0xD98D4B19
,
0x893A251C
,
0xAA6924BE
,
0xBA910F15
,
0xA9B34632
,
0xDC49B63B
,
0xA125D202
,
0x1E153833
,
0x44A897B5
,
0x5DF3AD99
,
0x3984C923
,
0x52F52692
,
0x471B5A4D
,
0x413B26D5
,
0x64BD2A63
,
0xBCC8D10D
,
0x9B19CBA4
,
0xE75277B9
,
0x2A8A6933
,
0xDF24D9F8
,
0x65B03518
,
0x88D8FCE2
,
0x1D87C609
,
0x3F71E663
,
0x12B02BAE
,
0xCA168CA6
,
0x83E91177
,
0xE94BA59E
,
0x77975B46
,
0x5DC0B431
,
0x6F940C79
,
0x234A4D00
,
0xE33B5110
,
0x43F422F1
,
0x5CFEFA0E
,
0x97018BE4
,
0xA042F93E
,
0x78CEE834
,
0x296E3609
,
0x622C3BF4
,
0xFBCDC3FB
,
0x9DBE670E
,
0xC073E528
,
0x58AC51A9
,
0x8333A59B
,
0x0C5E2480
,
0x93321265
,
0x137AD111
,
0x92C86613
,
0xEFF2D3D5
,
0x2310CD8C
,
0x281BCAD3
,
0xDF3FF3AA
,
0x3D5F454F
,
0xDA9F1F0D
,
0x3AE6A570
,
0xB2F8ACF0
,
0x4F271B03
,
0x636EE513
,
0x3CB336CB
,
0xB34BD5EF
,
0x55ED6801
,
0x3C28EDD4
,
0x7E8071EB
,
0x2753ACA0
,
0xE41B9DB7
,
0xB817E32A
,
0xD3B1ACFE
,
0x9C99D0A0
,
0x6F3F6B96
,
0xCE3DDB62
,
0x79CBC3A0
,
0x0E17F223
,
0x697474F5
,
0x4AF1A354
,
0x2B6B995D
,
0x3A1FFC28
,
0x6B190136
,
0x813E15B3
,
0xA7C3C074
,
0xEB602DEE
,
0x075B0A26
,
0x820F13A6
,
0x188748DD
,
0xA38AD7A6
,
0x371D4CA9
,
0xFBDCF297
,
0x6A03FB8D
,
0x4A70AE69
,
0x8B8A3F96
,
0x1F40734A
,
0xAC8E85F8
,
0x6DD7EB6C
,
0x7EA514DF
,
0x78E69630
,
0x878759D7
,
0xDC49AA71
,
0x8A8728F5
,
0x70FCE0FC
,
0x3D67452B
,
0x4AB23B80
,
0x21FA846A
,
0xB0A3E976
,
0x99AF0681
,
0x89485BD6
,
0x0D0853D7
,
0xC87F3990
,
0xBD856176
,
0x0AFA8A1E
,
0x041C79FF
,
0x2556E0B6
,
0x4283777D
,
0x1AE0E9DE
,
0x0ACDA034
,
0x4A30466A
,
0xBCE768DF
,
0xB0256A33
,
0x026B68F9
,
0xDF89120F
,
0xB3618203
,
0xF9BB23C1
,
0x1A6AA8E8
,
0xF6B83C04
,
0x9B3078EF
,
0x435921E4
,
0x33E1C9D6
,
0xC4269BF4
,
0xFF857F0E
,
0xFBBC0B2A
,
0x6BC5BC34
,
0x7C51886B
,
0x6B712B33
,
0x5C755D05
,
0xDFBA1AB8
,
0x339F5BAD
,
0xF2267FDD
,
0x64C62EBC
,
0x594D643B
,
0xF936F1C3
,
0xCA7191BC
,
0x9E6EAFA3
,
0xF5A46FE4
,
0x8E8873D5
,
0xA4139274
,
0x0C3AD48B
,
0x9A267F86
,
0x594704BF
,
0x708E43A0
,
0xF1A7E87B
,
0x33ED9446
,
0x917822DD
,
0xD9051619
,
0x1085F49F
,
0x65D4E981
,
0x6236D329
,
0x987A7977
,
0xF0333380
,
0x9239B9EC
,
0x3715E988
,
0x41141FD7
,
0xA13F0375
,
0xA820B2FC
,
0xD2EE0260
,
0x6C7939DE
,
0xCB250C59
,
0xF9B4BA87
,
0xF499016D
,
0x1709EEFE
,
0x2FA88C7D
,
0xBA39EAAA
,
0x33E629D5
,
0x8BDF95F7
,
0xEB6300E0
,
0xCDD9E7ED
,
0xB22F2379
,
0x387971A1
,
0xC4989C9D
,
0xF45CF5A5
,
0x17A7818D
,
0x62F1F5E7
,
0xB39843A4
,
0x4B356C99
,
0xD6059E6A
,
0xC0D4D916
,
0x5213FCAC
,
0xD17977E8
,
0x93BCE0A2
,
0x7F6E7557
,
0x143A0E68
,
0x4BC13C29
,
0x15EEBD55
,
0x64F13E7A
,
0x96263BF8
,
0x4C9DCCD4
,
0xABB90BC2
,
0x44564FF4
,
0x15C5D4A2
,
0x92BF93DF
,
0x88DD7E20
,
0x48AA572A
,
0x8BC08AC1
,
0x96290FAC
,
0x412753AE
,
0x5FC85DF0
,
0x18A345FD
,
0x5C350B21
,
0x9EB19808
,
0xCC98394B
,
0x75A964BB
,
0x3D05B418
,
0xDC8183BC
,
0x2DFEA07E
,
0x4D5420D7
,
0x8E6433FA
,
0x3A0DD21D
,
0xDE093044
,
0x46C70B90
,
0x6E6EAEA6
,
0x4C852056
,
0xC4C0DE59
,
0xD2DBD4C3
,
0x95ECCB96
,
0x2532A9C1
,
0xA7B1A13F
,
0x8A4ED15C
,
0xFD012D44
,
0xAA81F579
,
0xBADE503E
,
0xFC88F509
,
0xA7707ACA
,
0x8017492D
,
0x1DC3FFAB
,
0xF5A3332F
,
0x761CDFC8
,
0xCB7BF537
,
0xDF805D6D
,
0x7B8A7B21
,
0xDBDF2689
,
0x933ACDEC
,
0xC462D1BC
,
0x7CEAC38F
,
0xAAD4D068
,
0x873A6635
,
0xFD68682C
,
0x8BFAD93C
,
0x5ECCD070
,
0xA7E7DF5E
,
0x3B9EC4EA
,
0x1AA9E4F3
,
0xB7F2CC42
,
0x879E622E
,
0x766AAA44
,
0xD04ADCBB
,
0xB073073B
,
0x23E49537
,
0x9072D26E
,
0x79E95449
,
0xC6CF5BD5
,
0x83DAA46E
,
0xFBB82182
,
0x393660B5
,
0xCF3FE74D
,
0x2BC8ADFD
,
0x0E7073C8
,
0x59B38370
,
0x77004B86
,
0xE466A857
,
0xE7C98C37
,
0x33ACD076
,
0xF714AB2D
,
0x7C74158D
,
0x520DE73C
,
0xCFF2C3BF
,
0x1F1FC41D
,
0xCDC717E0
,
0xC6FD75B9
,
0x595779FA
,
0x8695CC03
,
0x015FBB96
,
0xA7C8844F
,
0x88FA407D
,
0xD92DF345
,
0x79858A10
,
0x6C3B52E0
,
0x0BA7B076
,
0x852EB21F
,
0xEAC2BA1C
,
0x588D204F
,
0xC043C966
,
0x9D4F440F
,
0x95F19188
,
0x872DAE89
,
0xB496BED0
,
0x36AAF573
,
0xABC5CBF7
,
0x601882C9
,
0xF62C6D2D
,
0x83E9276F
,
0x1E851AF7
,
0x11E56617
,
0xE381AA22
,
0x23872E14
,
0x563F1351
,
0x2E41EA11
,
0x55B9E3F4
,
0xA65F6CBE
,
0xC0061BA3
,
0x13F7F5ED
,
0x1FCAC43B
,
0xFF5B54BD
,
0x3EB0302C
,
0x80619FBD
,
0x54B2C9D5
,
0xFBF42A36
,
0x64BF8FE7
,
0x296AD5F5
,
0x162B0E1D
,
0xE100B34B
,
0xB080A6DA
,
0x14459D2A
,
0x5793A95D
,
0xFE8C3579
,
0xF66BC9AF
,
0xF3FDE61C
,
0xB8DD6A80
,
0x52556542
,
0xBFAE9683
,
0xF2663FF6
,
0x0A2AD60B
,
0xD95A2C0B
,
0xBCAA0EFD
,
0x1DA6EAD3
,
0x060DA04E
,
0xD7BF6846
,
0xF26FBFA2
,
0x514D0E84
,
0xACE516D6
,
0x61B20BD3
,
0x00198868
,
0xDB501990
,
0x6B352D25
,
0xB1D13CA3
,
0x927CDA88
,
0xA05F8C7B
,
0xCE1520A4
,
0x20875B9E
,
0xC3737F98
,
0xEF2BB54B
,
0x274FE7D8
,
0xC5B215C7
,
0xF3013DD8
,
0x1C801F47
,
0xC5BFE0D4
,
0x4157E39C
,
0x753EEDCB
,
0x022EBB01
,
0xA11272EE
,
0xCB2B9AC2
,
0xDD68D509
,
0x6D370297
,
0xD1B797B5
,
0x5184F5E1
,
0x75F75A53
,
0xCC849E35
,
0x618C7F22
,
0x197F36CD
,
0xA48666E8
,
0x2D554CDD
,
0xDF0FC30C
,
0x595D46E5
,
0x2FC10916
,
0xED0E156A
,
0x46E0DDE1
,
0xAE64F9C0
,
0x12CC2C13
,
0xEE4403D1
,
0xE533D892
,
0xFE595605
,
0x4604790D
,
0x803CF6AA
,
0x8DFD63CF
,
0x54D60899
,
0x8590B57E
,
0x397140EE
,
0x362AD074
,
0x0C4C6600
,
0x148B32C5
,
0x7EDF2402
,
0x857C9B42
,
0x23849DFC
,
0x0C9A22F2
,
0x4F8D65F4
,
0x4ED17FD2
,
0xF98C057A
,
0x4EF7E6E1
,
0xADAA8803
,
0x171B46C5
,
0xE5239AAE
,
0x5269A989
,
0xE98A6164
,
0x8115C340
,
0xB850277C
,
0x12B3DC95
,
0x6E9C2243
,
0xD86BB397
,
0x5EDFA619
,
0x67016A34
,
0x0B8F0307
,
0x497C7947
,
0x6DCDCBF2
,
0x26ABB02D
,
0x157C23DA
,
0xFEB0DC2A
,
0xD3ABDECC
,
0x441E9835
,
0x0E506068
,
0x407C4CE5
,
0x75CE382C
,
0x75756184
,
0x79191BE6
,
0x650B5AA4
,
0x95441AF8
,
0x0721EFA5
,
0x5F834955
,
0x5F775009
,
0x6FC4BF5D
,
0x07B9B28D
,
0x5B0C3407
,
0xCF622B61
,
0xEE06B8F3
,
0x6A207BEF
,
0x1E57CC62
,
0xC05D6618
,
0xF0A51B1F
,
0xE5FAD5CE
,
0xE8187CE3
,
0xB7B13F6E
,
0x3107FFB9
,
0xFAD6AE53
,
0xA530CB65
,
0x16417E6B
,
0xDAFC53EE
,
0x52126CE0
,
0x03774AA3
,
0x3EA7DF10
,
0x48010F66
,
0xEB77C464
,
0x46099FFB
,
0xDC6B9ECE
,
0x4D0E39A8
,
0xBA00D6F1
,
0x47A3A174
,
0x4BC0DC3C
,
0xA8FC61BD
,
0x1E937E8B
,
0xFB3BD002
,
0xA0B1BE03
,
0x8AF96C13
,
0x9EE7CF41
,
0xA776B208
,
0x843E951C
,
0x37E1DAA4
,
0x3C8C2681
,
0x9296D21D
,
0xDD216E3D
,
0x4923F357
,
0x6C4A5BA8
,
0x62A76612
,
0x83B4C690
,
0x3A4468A6
,
0x3656E5D9
,
0xE4FBE234
,
0x8C4457A6
,
0x41726880
,
0xE4EC0B0F
,
0x90FEFCCE
,
0xAC0A2EAA
,
0x2E133570
,
0x96806C74
,
0x00EFE5F1
,
0x028982D9
,
0x0C0BADFD
,
0x5BE983F2
,
0xDFD4B776
,
0xF61BFF31
,
0x06106654
,
0x66AFE70A
,
0xCAD56143
,
0x9E9D7368
,
0xCAAB3824
,
0x69E462E5
,
0x3DA295CE
,
0x676D201F
,
0x092F6CC9
,
0x3D2245A8
,
0x79C07ADF
,
0x91BB1257
,
0x53C3E5AC
,
0x2F5C690C
,
0x17C52299
,
0x348B4223
,
0x543CE6E8
,
0x3AD7D22C
,
0x841710BA
,
0x583F689F
,
0x30F56831
,
0x7E8FFAA1
,
0x7EB85021
,
0x2313C120
,
0xC7720FF1
,
0x606E16CB
,
0x036EDC90
,
0x7A0A29AC
,
0xF2963CB3
,
0x787DED71
,
0xFD6364B3
,
0x718256AC
,
0xFBD5C0C4
,
0xA4E0148C
,
0x535BA861
,
0xD1750DE0
,
0x10543417
,
0x41E2A75F
,
0x3045F720
,
0x66339C92
,
0xB68D0069
,
0xA6A6C9CB
,
0xB31F92EE
,
0xE6EBFD0E
,
0xCD2D8BA5
,
0x764A8CE0
,
0x3197FB3E
,
0xAA455F50
,
0x327D2488
,
0xA4F408B7
,
0xFE6F6440
,
0xE67008FF
,
0x5B449588
,
0xE893BF7E
,
0xBFAEDE65
,
0xC03EC09A
,
0x82E181F1
,
0xAC019DD3
,
0x25BCF222
,
0x538F37F0
,
0xCA4FF151
,
0x11792C56
,
0x9B39B3F3
,
0x39AA29D5
,
0x43B6AD16
,
0x84AEC679
,
0xEAB994A2
,
0xE79B1F12
,
0x21A95475
,
0x4600EA99
,
0xFB2671C8
,
0xCA0B0E9D
,
0xC71D4A8C
,
0x04E5F752
,
0x8A02AA94
,
0xF5284D09
,
0x653CE2CA
,
0x70E7EA0E
,
0x1C423CCB
,
0xF8D97F3F
,
0xF1166F8E
,
0xD384F2DF
,
0x672A2E0F
,
0x4320846E
,
0x2ADB170E
,
0x9364F18E
,
0xE2E6C563
,
0xFF6D8B3F
,
0xFD3B927A
,
0x8FC12FF4
,
0x848D58ED
,
0x90F1C64D
,
0xD3AF3B60
,
0xC2DCED87
,
0x3D46B3FE
,
0x530473D4
,
0x7C540B51
,
0x91429037
,
0x8CAB594F
,
0xDCA42CA8
,
0x73DC71C5
,
0xB2628E7A
,
0x752B258D
,
0x7649AE67
,
0xF1EA243B
,
0x236E66A5
,
0x76EE1618
,
0x12E094F1
,
0xF0834CA4
,
0x181B377E
,
0xE8343806
,
0xF10DB718
,
0x9C41BA01
,
0x339CCE0E
,
0x5E17036D
,
0x08321A94
,
0xE2B1F74A
,
0x67E33CBA
,
0xADEEA6E1
,
0xB814B339
,
0x1B526C92
,
0xE7324F94
,
0xF2C2073B
,
0x7A0C616B
,
0x5C00EE67
,
0x6DCB71EE
,
0x8B50779C
,
0xE226E3D1
,
0xDDA75F7E
,
0x73D7D930
,
0x10B06DB1
,
0x5D60B048
,
0xBFDE4890
,
0x4C4A08EB
,
0x336EB637
,
0x42CCE81A
,
0x74468A7E
,
0xE14B042D
,
0x61CDEDC1
,
0xEFCBDB6F
,
0x82C98EBB
,
0x4338C016
,
0x3D7E41B9
,
0x6661D003
,
0x310199EA
,
0x1180ABAB
,
0xA621BDA4
,
0xD7A6FF18
,
0xC70224C5
,
0x6DFA60EA
,
0x6871A8A9
,
0x7664FEAE
,
0xBCD25F41
,
0x8913D31D
,
0x2C1DB753
,
0x1E8509F1
,
0x7C6A41EF
,
0x58618E73
,
0xBCC61595
,
0xC035DCF3
,
0xA624D1A5
,
0xF73ADCCB
,
0x40FD8D0E
,
0xF8E7179B
,
0xDFA0795D
,
0xE332E3D3
,
0xDD514B8F
,
0xF3A35BDC
,
0x41309E5C
,
0x69BD1051
,
0xE5280DD9
,
0x1D319B29
,
0xF291D296
,
0x725C62C0
,
0x6022B2AA
,
0xB1F94727
,
0x96C44950
,
0x6EA2711E
,
0xDCC479FA
,
0xE32C59A4
,
0xCF067207
,
0xC83C3204
,
0x58C97481
,
0xB17567C7
,
0x8823DD90
,
0x2297E4F6
,
0x48F5E77D
,
0x84973489
,
0x81EAD180
,
0x4290ABFC
,
0x5591A8B1
,
0x8C4E7663
,
0xC0DD2DCD
,
0x5041AA71
,
0x526EB6B0
,
0x9E9DC448
,
0x745788B5
,
0x66EBBD1A
,
0xF18A915B
,
0x4DB6DDD6
,
0x89B3A4DE
,
0x51F61F7A
,
0x124E16A7
,
0x8333C2C7
,
0x4599A5BE
,
0xCDC39263
,
0xC567E7A3
,
0xF2854DAD
,
0x1205A63C
,
0x5C9AD7D0
,
0xD27999B9
,
0x00A445DE
,
0x5FBD9597
,
0x847A97F2
,
0xF1903833
,
0x5E6D1CAC
,
0x4F4D7E87
,
0x379E0388
,
0xF2E4DA01
,
0x04DDC9D9
,
0x7E5E9CA1
,
0xEFF8C773
,
0xB3EA4FB8
,
0xB9F07B49
,
0x249FE3FF
,
0x2B462589
,
0x3D792DDE
,
0xE9450BF9
,
0xD5BCDF1F
,
0x12B046A9
,
0x7C3BB764
,
0xC876762F
,
0x1E4A070B
,
0x1BD21A0E
,
0x368F6C73
,
0x4318B4F3
,
0x865BF9BA
,
0xDA2755E8
,
0xBA2A416B
,
0x892EC8BD
,
0xAFF132B6
,
0x5D236D28
,
0x042DC228
,
0xCBAFD36F
,
0x8FAC29FE
,
0xC1618E9B
,
0x3032A586
,
0x60AD7F85
,
0x8DD5FD2D
,
0xC7ED013A
,
0xDA7B9527
,
0x531D268A
,
0x828006DA
,
0xA6C271BF
,
0xEF262D73
,
0x1C686ACD
,
0x6C1D0842
,
0xFEA0057B
,
0x781D79DF
,
0xB7013855
,
0xCA50C924
,
0x2D434666
,
0x3E017172
,
0x5C806111
,
0x293F51EC
,
0x9D913C77
,
0x216B3785
,
0x86954853
,
0x82932413
,
0x62164836
,
0x9A2E24CA
,
0x5380517F
,
0x2B0414C5
,
0x4710928F
,
0xB5B1DC8E
,
0x543905FF
,
0x739EADC3
,
0xA91125E8
,
0xAC81F242
,
0x56FC2679
,
0x7FA6388A
,
0x196D0474
,
0xEDF3E337
,
0xB40D1B44
,
0x00E9D7B5
,
0x2378CFC9
,
0x878C68A8
,
0x6F397817
,
0x2707529F
,
0x221ED5B0
,
0x90D965FD
,
0x8E648703
,
0x889C774C
,
0xDE08963B
,
0xC405F74E
,
0xEF4C0EA2
,
0xC2123688
,
0xCE92171D
,
0x6BC26425
,
0xBC16C790
,
0xF2BADE50
,
0x144E9835
,
0x1871FA87
,
0x2250351A
,
0xC8AF1671
,
0x304B7D6B
,
0x2D2D1635
,
0xD9FCD535
,
0xF46B836F
,
0xC0B781BF
,
0xD945D82F
,
0x45ACDBB2
,
0x50EB33A8
,
0x2761879F
,
0xD0E25279
,
0xE022ECAE
,
0xDA193AB7
,
0x81E39A78
,
0x67272C20
,
0x5B878A4E
,
0x64361F1D
,
0x2B83F58E
,
0x2A9A017F
,
0x507929AC
,
0x8173FE1E
,
0x971F2410
,
0xF11304BE
,
0xDBD4230C
,
0xD9D689E8
,
0x790B8E66
,
0x4009A29B
,
0xC00CF152
,
0x8A9245FA
,
0x571808CE
,
0x18802F6C
,
0xEDAA74B8
,
0xAFF8A5C3
,
0xDCCC3726
,
0x8F8EE064
,
0x15152CBB
,
0xADB4F189
,
0x0D2ADA0A
,
0xF5CE9515
,
0x9DCB9D56
,
0xE6F8158C
,
0x36A35921
,
0x14E83535
,
0x135B5372
,
0x916FBF6B
,
0x9AE11EB4
,
0xB395A6A4
,
0x7A813C9C
,
0xF4C76DC5
,
0x0FFC9880
,
0xD9AD9FAD
,
0xB7CB45F8
,
0x73385623
,
0x947AF1CC
,
0x77A3D98B
,
0x18407675
,
0x00974514
,
0x50C6DABC
,
0x237B672F
,
0x7333F841
,
0x729DDC99
,
0xD09DF0E7
,
0x98C13440
,
0x45BAC57F
,
0x391ED4C3
,
0x32939D28
,
0xDE00F063
,
0x8B82EC37
,
0x55AB229A
,
0x8C837AB1
,
0x3086EABC
,
0x21469D8E
,
0xC2282941
,
0x0EDA9B65
,
0xB365A1B3
,
0xCA047C36
,
0x2B355957
,
0x57403D65
,
0xF0DE0AFA
,
0xD4C9DE27
,
0xE841E29F
,
0x8A9BC5EB
,
0x61B5D7CF
,
0x2472F58E
,
0x46195BE2
,
0xEFFF1557
,
0xC4F7397E
,
0x78901506
,
0x83B88513
,
0xEED98887
,
0x4049EA2A
,
0x3DDE8305
,
0xAAA987B4
,
0x24493B6B
,
0x2DCD7DCB
,
0x80B69098
,
0xB6395978
,
0x32A560D7
,
0x94593F7A
,
0x73B7E752
,
0x2DCE252A
,
0x84B5C39A
,
0x7A861EEC
,
0x24184281
,
0x78C0DDCD
,
0x58B8C4D0
,
0x482B723B
,
0xAA8807A3
,
0x339A6003
,
0x779A6B74
,
0xF53F8FEC
,
0x5EE37218
,
0xC1B6C5B2
,
0x47D45939
,
0xD499852D
,
0x351E4618
,
0x3157CFE4
,
0xCA97B899
,
0xDD216C5E
,
0x8E433EE6
,
0x65598AEE
,
0x325F782D
,
0xB0D127D2
,
0x003FAC45
,
0xD54A90D4
,
0x651A673F
,
0x8EBF84D6
,
0x25C6F32B
,
0x34DB8DEB
,
0xF702079D
,
0x688C0AF1
,
0xA420E5B4
,
0xFCAFEBC0
,
0x272C28B0
,
0x8C21FB6D
,
0xAA712659
,
0x4AD3C638
,
0xA1329FCC
,
0x8D2D4516
,
0x1C350A61
,
0x6EB98EF8
,
0x512DB1C8
,
0x2E047041
,
0xF298AF97
,
0xE5E40306
,
0x55F301D1
,
0x1276C70F
,
0xAD1B393C
,
0xA98756B0
,
0x0A54197B
,
0xA81E3DF2
,
0xA505683F
,
0xACB6BBAC
};
ccan/array/test/run.c
0 → 100644
View file @
ee7d1a1c
#include <stdio.h>
#include <tap/tap.h>
#include "array/array.h"
#define countof(array...) (sizeof(array)/sizeof(*(array)))
#include "lotsOfNumbers.h"
int
main
(
void
)
{
Array
(
long
)
array
=
NewArray
();
size_t
i
;
plan_tests
(
3
);
{
for
(
i
=
0
;
i
<
countof
(
lotsOfNumbers
);
i
++
)
AAppend
(
array
,
lotsOfNumbers
[
i
]);
ok1
(
array
.
size
==
countof
(
lotsOfNumbers
));
ok1
(
array
.
allocSize
>=
array
.
size
);
ok1
(
!
memcmp
(
array
.
item
,
lotsOfNumbers
,
sizeof
(
lotsOfNumbers
)));
}
AFree
(
array
);
AInit
(
array
);
return
0
;
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment