📄 new_ftp
字号:
#!/bin/shif [ $# != 1 ]; then echo "usage: $0 <dir>" echo " dir: directory name, must not exists, is the name of the FT protocol" echo " must be in the ch_v root" exit 1fimkdir $1cd $1cat >prototypes.h<<EOF/** @file prototypes.h defines the part of the mpi message header designed for the ft protocol */#ifndef prototypes_h_#define prototypes_h_/** the proto_header is included in pkt_header in vtypes.h */typedef struct proto_header { /** fill in the protocol here! */} proto_header;#ifdef DEBUG/** formats the protocol specific part. * @param f: the buffer to render * @param p: the packet header */void ftp_format_packet(char *f, pkt_header *pkt);#else#define ftp_format_packet(a,b) do {} while(0)#endif#endifEOFcat >elClient.h<<EOF/** @file elClient.h defines the communication between daemon and Event Logger * And defines the event logging structure inside daemon */#ifndef ELCLIENT_H#define ELCLIENT_H#include "debug.h"#include "config.h"#include <sys/types.h>#include <sys/socket.h>#include <netinet/in.h>/** the functions needed by the FT programming interface */#include "FTPI/ftp_elc.h"/** You may add other functions/structures here */#endif /* ELCLIENT_H_ */EOFcat >daemoncom.h<<EOF/** @file daemoncom.h defines the communication between daemons implied in the fault tolerant protocol */#ifndef DAEMONCOM_H#define DAEMONCOM_H#include "debug.h"#include "config.h"#include "connect.h"#include "vtypes.h"#include "flitvec.h"/** the functions needed by the FT programming interface */#include "FTPI/ftp_dcom.h"/** You may add other functions/structures here */#endif /*DAEMONCOM_H*/EOFcat >checkpoint.h<<EOF/** @file checkpoint.h defines the checkpoint API for daemon */#ifndef _CHECKPOINT_H_#define _CHECKPOINT_H_#include "config.h"#include "debug.h"/** add defines here */#include "FTPI/ftp_ckpt.h"/** add other functions here */#endifEOFcat >Makefile<<EOF#you may add whatever is needed in this file...SOURCES=checkpoint.c daemoncom.c elClient.cOBJECTS=\$(SOURCES:.c=.o)INCLUDES=checkpoint.h daemoncom.h elClient.h prototypes.hCFLAGS=-I. -I../ -I../daemon -I../driver -I../utils -I../checkpoint -Wall -gCC=gccall: libft.alibft.a: \$(OBJECTS) \$(AR) crl libft.a \$(OBJECTS)%.o: %.c \$(INCLUDES) \$(CC) \$(CFLAGS) -o \$@ -c \$<clean: rm -f libft.a *.oEOF
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -