libsnss.c
19.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
/**************************************************************************/
/*
libsnss.c
(C) 2000 The SNSS Group
See README.TXT file for license and terms of use.
$Id: libsnss.c,v 1.2 2001/04/27 14:37:11 neil Exp $
*/
/**************************************************************************/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <libsnss.h>
/**************************************************************************/
/* This section deals with endian-specific code. */
/**************************************************************************/
static unsigned int
swap32 (unsigned int source)
{
#ifdef USE_LITTLE_ENDIAN
char buffer[4];
buffer[0] = ((char *) &source)[3];
buffer[1] = ((char *) &source)[2];
buffer[2] = ((char *) &source)[1];
buffer[3] = ((char *) &source)[0];
return *((unsigned int *) buffer);
#else /* !USE_LITTLE_ENDIAN */
return source;
#endif /* !USE_LITTLE_ENDIAN */
}
static unsigned short
swap16 (unsigned short source)
{
#ifdef USE_LITTLE_ENDIAN
char buffer[2];
buffer[0] = ((char *) &source)[1];
buffer[1] = ((char *) &source)[0];
return *((unsigned short *) buffer);
#else /* !USE_LITTLE_ENDIAN */
return source;
#endif /* !USE_LITTLE_ENDIAN */
}
/**************************************************************************/
/* support functions */
/**************************************************************************/
#define MIN(a,b) (((a) < (b)) ? (a) : (b))
/**************************************************************************/
static SNSS_RETURN_CODE
SNSS_ReadBlockHeader (SnssBlockHeader *header, SNSS_FILE *snssFile)
{
char headerBytes[12];
if (fread (headerBytes, 12, 1, snssFile->fp) != 1)
{
return SNSS_READ_FAILED;
}
strncpy (header->tag, &headerBytes[0], TAG_LENGTH);
header->tag[4] = '\0';
header->blockVersion = *((unsigned int *) &headerBytes[4]);
header->blockVersion = swap32 (header->blockVersion);
header->blockLength = *((unsigned int *) &headerBytes[8]);
header->blockLength = swap32 (header->blockLength);
return SNSS_OK;
}
/**************************************************************************/
static SNSS_RETURN_CODE
SNSS_WriteBlockHeader (SnssBlockHeader *header, SNSS_FILE *snssFile)
{
char headerBytes[12];
unsigned int tempInt;
strncpy (&headerBytes[0], header->tag, TAG_LENGTH);
tempInt = swap32 (header->blockVersion);
headerBytes[4] = ((char *) &tempInt)[0];
headerBytes[5] = ((char *) &tempInt)[1];
headerBytes[6] = ((char *) &tempInt)[2];
headerBytes[7] = ((char *) &tempInt)[3];
tempInt = swap32 (header->blockLength);
headerBytes[8] = ((char *) &tempInt)[0];
headerBytes[9] = ((char *) &tempInt)[1];
headerBytes[10] = ((char *) &tempInt)[2];
headerBytes[11] = ((char *) &tempInt)[3];
if (fwrite (headerBytes, 12, 1, snssFile->fp) != 1)
{
return SNSS_WRITE_FAILED;
}
return SNSS_OK;
}
/**************************************************************************/
const char *
SNSS_GetErrorString (SNSS_RETURN_CODE code)
{
switch (code)
{
case SNSS_OK:
return "no error";
case SNSS_BAD_FILE_TAG:
return "not an SNSS file";
case SNSS_OPEN_FAILED:
return "could not open SNSS file";
case SNSS_CLOSE_FAILED:
return "could not close SNSS file";
case SNSS_READ_FAILED:
return "could not read from SNSS file";
case SNSS_WRITE_FAILED:
return "could not write to SNSS file";
case SNSS_OUT_OF_MEMORY:
return "out of memory";
case SNSS_UNSUPPORTED_BLOCK:
return "unsupported block type";
default:
return "unknown error";
}
}
/**************************************************************************/
/* functions for reading and writing SNSS file headers */
/**************************************************************************/
static SNSS_RETURN_CODE
SNSS_ReadFileHeader (SNSS_FILE *snssFile)
{
if (fread (snssFile->headerBlock.tag, 4, 1, snssFile->fp) != 1)
{
return SNSS_READ_FAILED;
}
if (0 != strncmp(snssFile->headerBlock.tag, "SNSS", 4))
{
return SNSS_BAD_FILE_TAG;
}
snssFile->headerBlock.tag[4] = '\0';
if (fread (&snssFile->headerBlock.numberOfBlocks, sizeof (unsigned int), 1, snssFile->fp) != 1)
{
return SNSS_READ_FAILED;
}
snssFile->headerBlock.numberOfBlocks = swap32 (snssFile->headerBlock.numberOfBlocks);
return SNSS_OK;
}
/**************************************************************************/
static SNSS_RETURN_CODE
SNSS_WriteFileHeader (SNSS_FILE *snssFile)
{
unsigned int tempInt;
char writeBuffer[8];
/* always place the SNSS tag in this field */
strncpy (&writeBuffer[0], "SNSS", 4);
tempInt = swap32 (snssFile->headerBlock.numberOfBlocks);
writeBuffer[4] = ((char *) &tempInt)[0];
writeBuffer[5] = ((char *) &tempInt)[1];
writeBuffer[6] = ((char *) &tempInt)[2];
writeBuffer[7] = ((char *) &tempInt)[3];
if (fwrite (writeBuffer, 8, 1, snssFile->fp) != 1)
{
return SNSS_WRITE_FAILED;
}
return SNSS_OK;
}
/**************************************************************************/
/* general file manipulation functions */
/**************************************************************************/
SNSS_RETURN_CODE
SNSS_OpenFile (SNSS_FILE **snssFile, const char *filename, SNSS_OPEN_MODE mode)
{
*snssFile = malloc(sizeof(SNSS_FILE));
if (NULL == *snssFile)
{
return SNSS_OUT_OF_MEMORY;
}
/* zero the memory */
memset (*snssFile, 0, sizeof(SNSS_FILE));
(*snssFile)->mode = mode;
if (SNSS_OPEN_READ == mode)
{
(*snssFile)->fp = fopen (filename, "rb");
}
else
{
(*snssFile)->fp = fopen (filename, "wb");
(*snssFile)->headerBlock.numberOfBlocks = 0;
}
if (NULL == (*snssFile)->fp)
{
free(*snssFile);
*snssFile = NULL;
return SNSS_OPEN_FAILED;
}
if (SNSS_OPEN_READ == mode)
{
return SNSS_ReadFileHeader(*snssFile);
}
else
{
return SNSS_WriteFileHeader(*snssFile);
}
}
/**************************************************************************/
SNSS_RETURN_CODE
SNSS_CloseFile (SNSS_FILE **snssFile)
{
return SNSS_OK;
}
/**************************************************************************/
SNSS_RETURN_CODE
SNSS_GetNextBlockType (SNSS_BLOCK_TYPE *blockType, SNSS_FILE *snssFile)
{
// REMOVED
return SNSS_OK;
}
/**************************************************************************/
SNSS_RETURN_CODE
SNSS_SkipNextBlock (SNSS_FILE *snssFile)
{
// REMOVED
return SNSS_OK;
}
/**************************************************************************/
/* functions for reading and writing base register blocks */
/**************************************************************************/
static SNSS_RETURN_CODE
SNSS_ReadBaseBlock (SNSS_FILE *snssFile)
{
char blockBytes[BASE_BLOCK_LENGTH];
SnssBlockHeader header;
if (SNSS_ReadBlockHeader (&header, snssFile) != SNSS_OK)
{
return SNSS_READ_FAILED;
}
if (fread (blockBytes, MIN (header.blockLength, BASE_BLOCK_LENGTH), 1, snssFile->fp) != 1)
{
return SNSS_READ_FAILED;
}
snssFile->baseBlock.regA = blockBytes[0x0];
snssFile->baseBlock.regX = blockBytes[0x1];
snssFile->baseBlock.regY = blockBytes[0x2];
snssFile->baseBlock.regFlags = blockBytes[0x3];
snssFile->baseBlock.regStack = blockBytes[0x4];
snssFile->baseBlock.regPc = *((unsigned short *) &blockBytes[0x5]);
snssFile->baseBlock.regPc = swap16 (snssFile->baseBlock.regPc);
snssFile->baseBlock.reg2000 = blockBytes[0x7];
snssFile->baseBlock.reg2001 = blockBytes[0x8];
memcpy (&snssFile->baseBlock.cpuRam, &blockBytes[0x9], 0x800);
memcpy (&snssFile->baseBlock.spriteRam, &blockBytes[0x809], 0x100);
memcpy (&snssFile->baseBlock.ppuRam, &blockBytes[0x909], 0x1000);
memcpy (&snssFile->baseBlock.palette, &blockBytes[0x1909], 0x20);
memcpy (&snssFile->baseBlock.mirrorState, &blockBytes[0x1929], 0x4);
snssFile->baseBlock.vramAddress = *((unsigned short *) &blockBytes[0x192D]);
snssFile->baseBlock.vramAddress = swap16 (snssFile->baseBlock.vramAddress);
snssFile->baseBlock.spriteRamAddress = blockBytes[0x192F];
snssFile->baseBlock.tileXOffset = blockBytes[0x1930];
return SNSS_OK;
}
/**************************************************************************/
static SNSS_RETURN_CODE
SNSS_WriteBaseBlock (SNSS_FILE *snssFile)
{
SnssBlockHeader header;
SNSS_RETURN_CODE returnCode;
char blockBytes[BASE_BLOCK_LENGTH];
unsigned short tempShort;
strcpy (header.tag, "BASR");
header.blockVersion = SNSS_BLOCK_VERSION;
header.blockLength = BASE_BLOCK_LENGTH;
if ((returnCode = SNSS_WriteBlockHeader (&header, snssFile)) != SNSS_OK)
{
return returnCode;
}
blockBytes[0x0] = snssFile->baseBlock.regA;
blockBytes[0x1] = snssFile->baseBlock.regX;
blockBytes[0x2] = snssFile->baseBlock.regY;
blockBytes[0x3] = snssFile->baseBlock.regFlags;
blockBytes[0x4] = snssFile->baseBlock.regStack;
tempShort = swap16 (snssFile->baseBlock.regPc);
blockBytes[0x5] = ((char *) &tempShort)[0];
blockBytes[0x6] = ((char *) &tempShort)[1];
blockBytes[0x7] = snssFile->baseBlock.reg2000;
blockBytes[0x8] = snssFile->baseBlock.reg2001;
memcpy (&blockBytes[0x9], &snssFile->baseBlock.cpuRam, 0x800);
memcpy (&blockBytes[0x809], &snssFile->baseBlock.spriteRam, 0x100);
memcpy (&blockBytes[0x909], &snssFile->baseBlock.ppuRam, 0x1000);
memcpy (&blockBytes[0x1909], &snssFile->baseBlock.palette, 0x20);
memcpy (&blockBytes[0x1929], &snssFile->baseBlock.mirrorState, 0x4);
tempShort = swap16 (snssFile->baseBlock.vramAddress);
blockBytes[0x192D] = ((char *) &tempShort)[0];
blockBytes[0x192E] = ((char *) &tempShort)[1];
blockBytes[0x192F] = snssFile->baseBlock.spriteRamAddress;
blockBytes[0x1930] = snssFile->baseBlock.tileXOffset;
if (fwrite (blockBytes, BASE_BLOCK_LENGTH, 1, snssFile->fp) != 1)
{
return SNSS_WRITE_FAILED;
}
snssFile->headerBlock.numberOfBlocks++;
return SNSS_OK;
}
/**************************************************************************/
/* functions for reading and writing VRAM blocks */
/**************************************************************************/
static SNSS_RETURN_CODE
SNSS_ReadVramBlock (SNSS_FILE *snssFile)
{
SnssBlockHeader header;
if (SNSS_ReadBlockHeader (&header, snssFile) != SNSS_OK)
{
return SNSS_READ_FAILED;
}
if (fread (snssFile->vramBlock.vram, MIN (header.blockLength, VRAM_16K), 1, snssFile->fp) != 1)
{
return SNSS_READ_FAILED;
}
snssFile->vramBlock.vramSize = header.blockLength;
return SNSS_OK;
}
/**************************************************************************/
static SNSS_RETURN_CODE
SNSS_WriteVramBlock (SNSS_FILE *snssFile)
{
SnssBlockHeader header;
SNSS_RETURN_CODE returnCode;
strcpy (header.tag, "VRAM");
header.blockVersion = SNSS_BLOCK_VERSION;
header.blockLength = snssFile->vramBlock.vramSize;
if ((returnCode = SNSS_WriteBlockHeader (&header, snssFile)) != SNSS_OK)
{
return returnCode;
}
if (fwrite (snssFile->vramBlock.vram, snssFile->vramBlock.vramSize, 1, snssFile->fp) != 1)
{
return SNSS_WRITE_FAILED;
}
snssFile->headerBlock.numberOfBlocks++;
return SNSS_OK;
}
/**************************************************************************/
/* functions for reading and writing SRAM blocks */
/**************************************************************************/
static SNSS_RETURN_CODE
SNSS_ReadSramBlock (SNSS_FILE *snssFile)
{
SnssBlockHeader header;
if (SNSS_ReadBlockHeader (&header, snssFile) != SNSS_OK)
{
return SNSS_READ_FAILED;
}
if (fread (&snssFile->sramBlock.sramEnabled, 1, 1, snssFile->fp) != 1)
{
return SNSS_READ_FAILED;
}
/* read blockLength - 1 bytes to get all of the SRAM */
if (fread (&snssFile->sramBlock.sram, MIN (header.blockLength - 1, SRAM_8K), 1, snssFile->fp) != 1)
{
return SNSS_READ_FAILED;
}
/* SRAM size is the size of the block - 1 (SRAM enabled byte) */
snssFile->sramBlock.sramSize = header.blockLength - 1;
return SNSS_OK;
}
/**************************************************************************/
static SNSS_RETURN_CODE
SNSS_WriteSramBlock (SNSS_FILE *snssFile)
{
SnssBlockHeader header;
SNSS_RETURN_CODE returnCode;
strcpy (header.tag, "SRAM");
header.blockVersion = SNSS_BLOCK_VERSION;
/* length of block is size of SRAM plus SRAM enabled byte */
header.blockLength = snssFile->sramBlock.sramSize + 1;
if ((returnCode = SNSS_WriteBlockHeader (&header, snssFile)) != SNSS_OK)
{
return returnCode;
}
if (fwrite (&snssFile->sramBlock.sramEnabled, 1, 1, snssFile->fp) != 1)
{
return SNSS_WRITE_FAILED;
}
if (fwrite (snssFile->sramBlock.sram, snssFile->sramBlock.sramSize, 1, snssFile->fp) != 1)
{
return SNSS_WRITE_FAILED;
}
snssFile->headerBlock.numberOfBlocks++;
return SNSS_OK;
}
/**************************************************************************/
/* functions for reading and writing mapper data blocks */
/**************************************************************************/
static SNSS_RETURN_CODE
SNSS_ReadMapperBlock (SNSS_FILE *snssFile)
{
char *blockBytes;
int i;
SnssBlockHeader header;
if (SNSS_ReadBlockHeader (&header, snssFile) != SNSS_OK)
{
return SNSS_READ_FAILED;
}
if ((blockBytes = (char *) malloc (0x8 + 0x10 + 0x80)) == NULL)
{
return SNSS_OUT_OF_MEMORY;
}
if (fread (blockBytes, MIN (0x8 + 0x10 + 0x80, header.blockLength), 1, snssFile->fp) != 1)
{
free(blockBytes);
return SNSS_READ_FAILED;
}
for (i = 0; i < 4; i++)
{
snssFile->mapperBlock.prgPages[i] = *((unsigned short *) &blockBytes[i * 2]);
snssFile->mapperBlock.prgPages[i] = swap16 (snssFile->mapperBlock.prgPages[i]);
}
for (i = 0; i < 8; i++)
{
snssFile->mapperBlock.chrPages[i] = *((unsigned short *) &blockBytes[0x8 + (i * 2)]);
snssFile->mapperBlock.chrPages[i] = swap16 (snssFile->mapperBlock.chrPages[i]);
}
memcpy (&snssFile->mapperBlock.extraData.mapperData, &blockBytes[0x18], 0x80);
free (blockBytes);
return SNSS_OK;
}
/**************************************************************************/
static SNSS_RETURN_CODE
SNSS_WriteMapperBlock (SNSS_FILE *snssFile)
{
SnssBlockHeader header;
char blockBytes[MAPPER_BLOCK_LENGTH];
unsigned short tempShort;
int i;
SNSS_RETURN_CODE returnCode;
strcpy (header.tag, "MPRD");
header.blockVersion = SNSS_BLOCK_VERSION;
header.blockLength = MAPPER_BLOCK_LENGTH;
if ((returnCode = SNSS_WriteBlockHeader (&header, snssFile)) != SNSS_OK)
{
return returnCode;
}
for (i = 0; i < 4; i++)
{
tempShort = swap16 (snssFile->mapperBlock.prgPages[i]);
blockBytes[(i * 2) + 0] = ((char *) &tempShort)[0];
blockBytes[(i * 2) + 1] = ((char *) &tempShort)[1];
}
for (i = 0; i < 8; i++)
{
tempShort = swap16 (snssFile->mapperBlock.chrPages[i]);
blockBytes[0x8 + (i * 2) + 0] = ((char *) &tempShort)[0];
blockBytes[0x8 + (i * 2) + 1] = ((char *) &tempShort)[1];
}
memcpy (&blockBytes[0x18], &snssFile->mapperBlock.extraData.mapperData, 0x80);
if (fwrite (blockBytes, MAPPER_BLOCK_LENGTH, 1, snssFile->fp) != 1)
{
return SNSS_WRITE_FAILED;
}
snssFile->headerBlock.numberOfBlocks++;
return SNSS_OK;
}
/**************************************************************************/
/* functions for reading and writing controller data blocks */
/**************************************************************************/
static SNSS_RETURN_CODE
SNSS_ReadControllersBlock (SNSS_FILE *snssFile)
{
/* quell warnings */
snssFile = snssFile;
return SNSS_OK;
}
/**************************************************************************/
static SNSS_RETURN_CODE
SNSS_WriteControllersBlock (SNSS_FILE *snssFile)
{
/* quell warnings */
snssFile = snssFile;
return SNSS_OK;
}
/**************************************************************************/
/* functions for reading and writing sound blocks */
/**************************************************************************/
static SNSS_RETURN_CODE
SNSS_ReadSoundBlock (SNSS_FILE *snssFile)
{
SnssBlockHeader header;
if (SNSS_ReadBlockHeader (&header, snssFile) != SNSS_OK)
{
return SNSS_READ_FAILED;
}
if (fread (snssFile->soundBlock.soundRegisters, MIN (header.blockLength, 0x16), 1, snssFile->fp) != 1)
{
return SNSS_READ_FAILED;
}
return SNSS_OK;
}
/**************************************************************************/
static SNSS_RETURN_CODE
SNSS_WriteSoundBlock (SNSS_FILE *snssFile)
{
SnssBlockHeader header;
SNSS_RETURN_CODE returnCode;
strcpy (header.tag, "SOUN");
header.blockVersion = SNSS_BLOCK_VERSION;
header.blockLength = SOUND_BLOCK_LENGTH;
if ((returnCode = SNSS_WriteBlockHeader (&header, snssFile)) != SNSS_OK)
{
return returnCode;
}
if (fwrite (snssFile->soundBlock.soundRegisters, SOUND_BLOCK_LENGTH, 1, snssFile->fp) != 1)
{
return SNSS_WRITE_FAILED;
}
snssFile->headerBlock.numberOfBlocks++;
return SNSS_OK;
}
/**************************************************************************/
/* general functions for reading and writing SNSS data blocks */
/**************************************************************************/
SNSS_RETURN_CODE
SNSS_ReadBlock (SNSS_FILE *snssFile, SNSS_BLOCK_TYPE blockType)
{
switch (blockType)
{
case SNSS_BASR:
return SNSS_ReadBaseBlock (snssFile);
case SNSS_VRAM:
return SNSS_ReadVramBlock (snssFile);
case SNSS_SRAM:
return SNSS_ReadSramBlock (snssFile);
case SNSS_MPRD:
return SNSS_ReadMapperBlock (snssFile);
case SNSS_CNTR:
return SNSS_ReadControllersBlock (snssFile);
case SNSS_SOUN:
return SNSS_ReadSoundBlock (snssFile);
case SNSS_UNKNOWN_BLOCK:
default:
return SNSS_UNSUPPORTED_BLOCK;
}
}
/**************************************************************************/
SNSS_RETURN_CODE
SNSS_WriteBlock (SNSS_FILE *snssFile, SNSS_BLOCK_TYPE blockType)
{
switch (blockType)
{
case SNSS_BASR:
return SNSS_WriteBaseBlock (snssFile);
case SNSS_VRAM:
return SNSS_WriteVramBlock (snssFile);
case SNSS_SRAM:
return SNSS_WriteSramBlock (snssFile);
case SNSS_MPRD:
return SNSS_WriteMapperBlock (snssFile);
case SNSS_CNTR:
return SNSS_WriteControllersBlock (snssFile);
case SNSS_SOUN:
return SNSS_WriteSoundBlock (snssFile);
case SNSS_UNKNOWN_BLOCK:
default:
return SNSS_UNSUPPORTED_BLOCK;
}
}
/*
** $Log: libsnss.c,v $
** Revision 1.2 2001/04/27 14:37:11 neil
** wheeee
**
** Revision 1.1 2001/04/27 12:54:40 neil
** blah
**
** Revision 1.1.1.1 2001/04/27 07:03:54 neil
** initial
**
** Revision 1.1 2000/10/24 12:19:01 matt
** changed directory structure
**
** Revision 1.9 2000/10/10 13:03:54 matt
** Mr. Clean makes a guest appearance
**
** Revision 1.8 2000/08/16 02:58:34 matt
** random cleanups
**
** Revision 1.7 2000/07/17 01:52:27 matt
** made sure last line of all source files is a newline
**
** Revision 1.6 2000/07/10 01:54:16 matt
** state is now zeroed when it is allocated
**
** Revision 1.5 2000/07/09 15:37:21 matt
** all block read/write calls now pass through a common handler
**
** Revision 1.4 2000/07/09 03:39:06 matt
** minor modifications
**
** Revision 1.3 2000/07/08 16:01:39 matt
** added bald's changes, made error checking more robust
**
** Revision 1.2 2000/07/04 04:46:06 matt
** simplified handling of SNSS states
**
** Revision 1.1 2000/06/29 14:13:28 matt
** initial revision
**
*/