⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 blokstak.cpp

📁 基于单片机的 snmp协议解析的一些原代码 给有用的 同行
💻 CPP
字号:
//  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 + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -