xsupconfig_parse_devices.c

来自「linux 下通过802.1认证的安装包」· C语言 代码 · 共 58 行

C
58
字号
/**
 * Licensed under a dual GPL/BSD license.  (See LICENSE file for more info.)
 *
 * \file xsupconfig_parse_devices.c
 *
 * \author chris@open1x.org
 *
 * $Id: xsupconfig_parse_devices.c,v 1.1.2.8 2007/06/05 16:32:37 chessing Exp $
 * $Date: 2007/06/05 16:32:37 $
 **/

#include <stdio.h>

#ifndef WINDOWS
#include <stdint.h>
#endif

#include <libxml/parser.h>
#include <libxml/tree.h>
#include <string.h>

#include "xsupconfig_structs.h"
#include "../../src/xsup_common.h"
#include "xsupconfig_parse.h"
#include "xsupconfig.h"
#include "xsupconfig_vars.h"
#include "xsupconfig_common.h"
#include "xsupconfig_parse_interface.h"
#include "xsupconfig_parse_devices.h"
#include "xsupconfig_devices.h"
#include "../../src/xsup_debug.h"

void *xsupconfig_parse_devices(void **attr, xmlNodePtr node)
{
#ifdef PARSE_DEBUG
  printf("Building devices config.\n");
#endif

  conf_devices = malloc(sizeof(struct xsup_devices));
  if (conf_devices == NULL)
    {
      debug_printf(DEBUG_NORMAL, "Couldn't allocate memory to store device configuration!"
	     "  (Line %ld)\n", xsupconfig_parse_get_line_num());
      exit(1);
    }

  memset(conf_devices, 0x00, sizeof(struct xsup_devices));

  return conf_devices;
}


parser devices[] = {
  {"Interface", (struct conf_parse_struct *)&interf, TRUE, 
	xsupconfig_parse_interface},
  
  {NULL, NULL, FALSE, NULL}};

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?