Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

template for plugin

SVN Revision: 506
  • Loading branch information...
commit dd25ba99e18f1f748697c78d43e1484150cb02aa 1 parent ea00068
Nicolas Niclausse authored August 16, 2005

Showing 1 changed file with 103 additions and 0 deletions. Show diff stats Hide diff stats

  1. 103  doc/ts_template.erl
103  doc/ts_template.erl
... ...
@@ -0,0 +1,103 @@
  1
+%%%  This program is free software; you can redistribute it and/or modify
  2
+%%%  it under the terms of the GNU General Public License as published by
  3
+%%%  the Free Software Foundation; either version 2 of the License, or
  4
+%%%  (at your option) any later version.
  5
+%%%
  6
+%%%  This program is distributed in the hope that it will be useful,
  7
+%%%  but WITHOUT ANY WARRANTY; without even the implied warranty of
  8
+%%%  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  9
+%%%  GNU General Public License for more details.
  10
+%%%
  11
+%%%  You should have received a copy of the GNU General Public License
  12
+%%%  along with this program; if not, write to the Free Software
  13
+%%%  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
  14
+%%% 
  15
+
  16
+%%% In addition, as a special exception, you have the permission to
  17
+%%% link the code of this program with any library released under
  18
+%%% the EPL license and distribute linked combinations including
  19
+%%% the two.
  20
+
  21
+-module(ts_template).
  22
+-vc('$Id$ ').
  23
+-author('').
  24
+
  25
+-include("ts_profile.hrl").
  26
+
  27
+-export([init_dynparams/0,
  28
+		 add_dynparams/4,
  29
+		 get_message/1,
  30
+		 session_defaults/0,
  31
+         parse/2,
  32
+         parse_config/2,
  33
+         new_session/0]).
  34
+
  35
+%%----------------------------------------------------------------------
  36
+%% Function: session_default/0
  37
+%% Purpose: default parameters for session
  38
+%% Returns: {ok, ack_type = parse|no_ack|local, persistent = true|false} 
  39
+%%----------------------------------------------------------------------
  40
+session_defaults() ->
  41
+    todo.
  42
+
  43
+%%----------------------------------------------------------------------
  44
+%% Function: new_session/0
  45
+%% Purpose: initialize session information
  46
+%% Returns: record or []
  47
+%%----------------------------------------------------------------------
  48
+new_session() ->
  49
+	#myproto_session{}.
  50
+
  51
+%%----------------------------------------------------------------------
  52
+%% Function: get_message/21
  53
+%% Purpose: Build a message/request ,
  54
+%% Args:	record
  55
+%% Returns: binary
  56
+%%----------------------------------------------------------------------
  57
+get_message(Req=#myproto_request{}) ->
  58
+    todo.
  59
+
  60
+%%----------------------------------------------------------------------
  61
+%% Function: parse/2
  62
+%% Purpose: parse the response from the server and keep information
  63
+%%          about the response in State#state_rcv.session
  64
+%% Args:	Data (binary), State (#state_rcv)
  65
+%% Returns: {NewState, Options for socket (list), Close = true|false}
  66
+%%----------------------------------------------------------------------
  67
+parse(Data, State) ->
  68
+	todo.
  69
+
  70
+%%----------------------------------------------------------------------
  71
+%% Function: parse_config/2
  72
+%% Purpose:  parse tags in the XML config file related to the protocol
  73
+%% Returns:  List
  74
+%%----------------------------------------------------------------------
  75
+parse_config(Element, Conf) ->
  76
+	todo.
  77
+
  78
+%%----------------------------------------------------------------------
  79
+%% Function: add_dynparams/4
  80
+%% Purpose: add dynamic parameters to build the message
  81
+%%          (this is used for ex. for Cookies in HTTP)
  82
+%% Args: Subst (true|false), DynData = #dyndata, Param = #myproto_request
  83
+%%                                               Host  = String
  84
+%% Returns: #myproto_request
  85
+%%----------------------------------------------------------------------
  86
+add_dynparams(false, DynData, Param, HostData) ->
  87
+    todo.
  88
+
  89
+%%----------------------------------------------------------------------
  90
+%% Function: init_dynparams/0
  91
+%% Purpose:  initial dynamic parameters value
  92
+%% Returns:  #dyndata
  93
+%%----------------------------------------------------------------------
  94
+init_dynparams() ->
  95
+    todo.
  96
+
  97
+%%----------------------------------------------------------------------
  98
+%% Function: subst/2
  99
+%% Purpose: Replace on the fly dynamic element of the request.
  100
+%% Returns: #myproto_request
  101
+%%----------------------------------------------------------------------
  102
+subst(Req=#myproto_request, DynData) ->
  103
+    todo.

0 notes on commit dd25ba9

Please sign in to comment.
Something went wrong with that request. Please try again.