~ps10gel/ubuntu/xenial/trafficserver/6.2.0

« back to all changes in this revision

Viewing changes to proxy/mgmt2/WebPluginList.cc

  • Committer: Bazaar Package Importer
  • Author(s): Arno Toell
  • Date: 2011-01-13 11:49:18 UTC
  • Revision ID: james.westby@ubuntu.com-20110113114918-vu422h8dknrgkj15
Tags: upstream-2.1.5-unstable
ImportĀ upstreamĀ versionĀ 2.1.5-unstable

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/** @file
 
2
 
 
3
  A brief file description
 
4
 
 
5
  @section license License
 
6
 
 
7
  Licensed to the Apache Software Foundation (ASF) under one
 
8
  or more contributor license agreements.  See the NOTICE file
 
9
  distributed with this work for additional information
 
10
  regarding copyright ownership.  The ASF licenses this file
 
11
  to you under the Apache License, Version 2.0 (the
 
12
  "License"); you may not use this file except in compliance
 
13
  with the License.  You may obtain a copy of the License at
 
14
 
 
15
      http://www.apache.org/licenses/LICENSE-2.0
 
16
 
 
17
  Unless required by applicable law or agreed to in writing, software
 
18
  distributed under the License is distributed on an "AS IS" BASIS,
 
19
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 
20
  See the License for the specific language governing permissions and
 
21
  limitations under the License.
 
22
 */
 
23
 
 
24
#include "libts.h"
 
25
 
 
26
#include "WebPluginList.h"
 
27
 
 
28
/****************************************************************************
 
29
 *
 
30
 *  WebPluginList.cc - Keep track of a list of web configurable plugins
 
31
 *
 
32
 *
 
33
 *
 
34
 ****************************************************************************/
 
35
 
 
36
WebPluginList::WebPluginList(void)
 
37
{
 
38
  head = tail = NULL;
 
39
}
 
40
 
 
41
WebPluginList::~WebPluginList(void)
 
42
{
 
43
  WebPluginConfig *cur = head, *save;
 
44
  while (cur != NULL) {
 
45
    save = cur;
 
46
    cur = cur->next;
 
47
    delete save;
 
48
  }
 
49
}
 
50
 
 
51
void
 
52
WebPluginList::clear(void)
 
53
{
 
54
  WebPluginConfig *cur = head, *save;
 
55
  while (cur != NULL) {
 
56
    save = cur;
 
57
    cur = cur->next;
 
58
    delete save;
 
59
  }
 
60
  head = tail = NULL;
 
61
}
 
62
 
 
63
void
 
64
WebPluginList::add(const char *name, const char *config_path)
 
65
{
 
66
  WebPluginConfig *new_plugin = new WebPluginConfig(name, config_path);
 
67
  if (head == NULL) {
 
68
    head = new_plugin;
 
69
  } else {
 
70
    tail->next = new_plugin;
 
71
  }
 
72
  tail = new_plugin;
 
73
}
 
74
 
 
75
WebPluginConfig *
 
76
WebPluginList::getFirst()
 
77
{
 
78
  return head;
 
79
}
 
80
 
 
81
WebPluginConfig *
 
82
WebPluginList::getNext(WebPluginConfig * wpc)
 
83
{
 
84
  if (wpc) {
 
85
    return wpc->next;
 
86
  }
 
87
  return NULL;
 
88
}