File: prot.c

package info (click to toggle)
afbackup 3.3.6pl4-1
  • links: PTS
  • area: main
  • in suites: woody
  • size: 3,872 kB
  • ctags: 3,143
  • sloc: ansic: 44,316; tcl: 4,189; sh: 2,263; csh: 2,077; makefile: 566; sed: 93; perl: 80
file content (47 lines) | stat: -rw-r--r-- 1,146 bytes parent folder | download
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
/****************** Start of $RCSfile: prot.c,v $  ****************
*
* $Source: /home/alb/afbackup/afbackup-3.3.6/RCS/prot.c,v $
* $Id: prot.c,v 1.1 2001/11/02 10:37:28 alb Exp alb $
* $Date: 2001/11/02 10:37:28 $
* $Author: alb $
*
*
******* description ***********************************************
*
*
*
*******************************************************************/

#include <conf.h>
#include <version.h>

  static char * fileversion = "$RCSfile: prot.c,v $ $Source: /home/alb/afbackup/afbackup-3.3.6/RCS/prot.c,v $ $Id: prot.c,v 1.1 2001/11/02 10:37:28 alb Exp alb $ " PACKAGE " " VERSION_STRING;

#include <ctype.h>
#include <stdio.h>
#include <string.h>
#include <prot.h>

static AFBProtocol	prot[] = AFB_PROTOCOL;

static AFBProtocol	*(prot_items[256]);

AFBProtocol **
init_prot_spec()
{
  Int32		i;
  AFBProtocol	*nop = NULL;

  memset(prot_items, 0, 256 * sizeof(prot_items[0]));
  for(i = 0; i < sizeof(prot) / sizeof(prot[0]); i++){
    prot_items[prot[i].cmd] = prot + i;
    if(prot[i].cmd == NOOPERATION)
	nop = prot + i;
  }

  for(i = 0; i < 256; i++)
    if(isspace(i))
	prot_items[i] = nop;

  return(prot_items);
}