blokstak.cpp
来自「基于单片机的 snmp协议解析的一些原代码 给有用的 同行」· C++ 代码 · 共 84 行
CPP
84 行
// Copyright (c) 1996 Federal Highway Administration
//
// This software has been developed for the Federal Highway Administration
// by Viggen Corporation under contract with Oak Ridge National Lab.
//
// Permission to use, copy, and distribute this software for any purpose
// without fee is hereby granted, provided that the above copyright notice
// appears in all copies and that both the copyright and this permission notice
// appear in the supporting documentation.
//
// Permission to modify this software is granted provided that the above
// copyright and this permission notice appears in the modified software.
//
// This software is provided "as is" with no warranty expressed or implied.
//
// For additional information, please go to the Web site www.ntcip.org.
//
/*******************************************************************************
*
* Copyright (c) 1997 Viggen Corporation
*
* Permission to use, copy, and distribute this software for any purpose
* without fee is hereby granted, provided that this copyright notice
* appears in all copies and this permission notice appears in the
* supporting documentation.
*
* Permission to modify this software is granted provided that the above
* copyright and this permission notice appears in the modified software.
*
******************************************************************************/
/*********************************************
*
* blokstak.cpp
*
* 9/29/97 Glenn Pruitt
*********************************************/
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include "lexical.h"
#include "blokstak.h"
void block_push(struct BLOCK_REC **the_stack, int start, int end)
{
struct BLOCK_REC *curr;
curr = (struct BLOCK_REC *)safe_alloc(1,sizeof(struct BLOCK_REC));
curr->start = start;
curr->end = end;
curr->next = *the_stack;
*the_stack = curr;
return;
}
void block_pop(struct BLOCK_REC **the_stack)
{
struct BLOCK_REC *curr;
curr = *the_stack;
*the_stack = curr->next;
safe_free(curr);
return;
}
int get_top_start(struct BLOCK_REC *the_stack)
{
struct BLOCK_REC *curr;
curr = the_stack;
return(curr->start);
}
int get_top_end(struct BLOCK_REC *the_stack)
{
struct BLOCK_REC *curr;
curr = the_stack;
return(curr->end);
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?