plugins/include/protobuf.inc
author Nicholas Hastings <skamonkey@gmail.com>
Sun Mar 17 11:39:04 2013 -0400 (2013-03-17)
changeset 3833 7563b32966af
parent 3814 ba22878ca775
child 3896 cb7537c1da4d
permissions -rw-r--r--
Moved PCRE_STATIC def in Regex ext to extension instead of modifying pcre header (bug 5593).
skamonkey@3743
     1
/**
skamonkey@3743
     2
 * vim: set ts=4 :
skamonkey@3743
     3
 * =============================================================================
skamonkey@3743
     4
 * SourceMod (C)2013 AlliedModders LLC.  All rights reserved.
skamonkey@3743
     5
 * =============================================================================
skamonkey@3743
     6
 *
skamonkey@3743
     7
 * This file is part of the SourceMod/SourcePawn SDK.
skamonkey@3743
     8
 *
skamonkey@3743
     9
 * This program is free software; you can redistribute it and/or modify it under
skamonkey@3743
    10
 * the terms of the GNU General Public License, version 3.0, as published by the
skamonkey@3743
    11
 * Free Software Foundation.
skamonkey@3743
    12
 * 
skamonkey@3743
    13
 * This program is distributed in the hope that it will be useful, but WITHOUT
skamonkey@3743
    14
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
skamonkey@3743
    15
 * FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
skamonkey@3743
    16
 * details.
skamonkey@3743
    17
 *
skamonkey@3743
    18
 * You should have received a copy of the GNU General Public License along with
skamonkey@3743
    19
 * this program.  If not, see <http://www.gnu.org/licenses/>.
skamonkey@3743
    20
 *
skamonkey@3743
    21
 * As a special exception, AlliedModders LLC gives you permission to link the
skamonkey@3743
    22
 * code of this program (as well as its derivative works) to "Half-Life 2," the
skamonkey@3743
    23
 * "Source Engine," the "SourcePawn JIT," and any Game MODs that run on software
skamonkey@3743
    24
 * by the Valve Corporation.  You must obey the GNU General Public License in
skamonkey@3743
    25
 * all respects for all other code used.  Additionally, AlliedModders LLC grants
skamonkey@3743
    26
 * this exception to all derivative works.  AlliedModders LLC defines further
skamonkey@3743
    27
 * exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007),
skamonkey@3743
    28
 * or <http://www.sourcemod.net/license.php>.
skamonkey@3743
    29
 *
skamonkey@3743
    30
 * Version: $Id$
skamonkey@3743
    31
 */
skamonkey@3743
    32
 
skamonkey@3743
    33
#if defined _protobuf_included
skamonkey@3743
    34
#endinput
skamonkey@3743
    35
#endif
skamonkey@3743
    36
#define _protobuf_included
skamonkey@3743
    37
skamonkey@3813
    38
#define PB_FIELD_NOT_REPEATED -1
skamonkey@3813
    39
skamonkey@3743
    40
/**
skamonkey@3743
    41
 * Reads an int32, uint32, sint32, fixed32, or sfixed32 from a protobuf message.
skamonkey@3743
    42
 *
skamonkey@3743
    43
 * @param pb			protobuf handle.
skamonkey@3743
    44
 * @param field			Field name.
skamonkey@3813
    45
 * @param index			Index into repeated field.
skamonkey@3743
    46
 * @return				Integer value read.
skamonkey@3743
    47
 * @error				Invalid or incorrect Handle, non-existant field, or incorrect field type.
skamonkey@3743
    48
 */
skamonkey@3813
    49
native PbReadInt(Handle:pb, const String:field[], index=PB_FIELD_NOT_REPEATED);
skamonkey@3743
    50
skamonkey@3743
    51
/**
skamonkey@3743
    52
 * Reads a float or downcasted double from a protobuf message.
skamonkey@3743
    53
 *
skamonkey@3743
    54
 * @param pb			protobuf handle.
skamonkey@3743
    55
 * @param field			Field name.
skamonkey@3813
    56
 * @param index			Index into repeated field.
skamonkey@3743
    57
 * @return				Float value read.
skamonkey@3743
    58
 * @error				Invalid or incorrect Handle, non-existant field, or incorrect field type.
skamonkey@3743
    59
 */
skamonkey@3813
    60
native Float:PbReadFloat(Handle:pb, const String:field[], index=PB_FIELD_NOT_REPEATED);
skamonkey@3743
    61
skamonkey@3743
    62
/**
skamonkey@3743
    63
 * Reads a bool from a protobuf message.
skamonkey@3743
    64
 *
skamonkey@3743
    65
 * @param pb			protobuf handle.
skamonkey@3743
    66
 * @param field			Field name.
skamonkey@3813
    67
 * @param index			Index into repeated field.
skamonkey@3743
    68
 * @return				Boolean value read.
skamonkey@3743
    69
 * @error				Invalid or incorrect Handle, non-existant field, or incorrect field type.
skamonkey@3743
    70
 */
skamonkey@3813
    71
native bool:PbReadBool(Handle:pb, const String:field[], index=PB_FIELD_NOT_REPEATED);
skamonkey@3743
    72
skamonkey@3743
    73
/**
skamonkey@3743
    74
 * Reads a string from a protobuf message.
skamonkey@3743
    75
 *
skamonkey@3743
    76
 * @param pb			protobuf handle.
skamonkey@3743
    77
 * @param field			Field name.
skamonkey@3743
    78
 * @param buffer		Destination string buffer.
skamonkey@3743
    79
 * @param maxlength		Maximum length of output string buffer.
skamonkey@3813
    80
 * @param index			Index into repeated field.
skamonkey@3743
    81
 * @noreturn
skamonkey@3743
    82
 * @error				Invalid or incorrect Handle, non-existant field, or incorrect field type.
skamonkey@3743
    83
 */
skamonkey@3813
    84
native PbReadString(Handle:pb, const String:field[], String:buffer[], maxlength, index=PB_FIELD_NOT_REPEATED);
skamonkey@3743
    85
skamonkey@3743
    86
/**
skamonkey@3743
    87
 * Reads an RGBA color value from a protobuf message.
skamonkey@3743
    88
 *
skamonkey@3743
    89
 * @param pb			protobuf handle.
skamonkey@3743
    90
 * @param field			Field name.
skamonkey@3743
    91
 * @param buffer		Destination color buffer.
skamonkey@3813
    92
 * @param index			Index into repeated field.
skamonkey@3743
    93
 * @noreturn
skamonkey@3743
    94
 * @error				Invalid or incorrect Handle, non-existant field, or incorrect field type.
skamonkey@3743
    95
 */
skamonkey@3813
    96
native PbReadColor(Handle:pb, const String:field[], buffer[4], index=PB_FIELD_NOT_REPEATED);
skamonkey@3743
    97
skamonkey@3743
    98
/**
skamonkey@3743
    99
 * Reads an XYZ angle value from a protobuf message.
skamonkey@3743
   100
 *
skamonkey@3743
   101
 * @param pb			protobuf handle.
skamonkey@3743
   102
 * @param field			Field name.
skamonkey@3743
   103
 * @param buffer		Destination angle buffer.
skamonkey@3813
   104
 * @param index			Index into repeated field.
skamonkey@3743
   105
 * @noreturn
skamonkey@3743
   106
 * @error				Invalid or incorrect Handle, non-existant field, or incorrect field type.
skamonkey@3743
   107
 */
skamonkey@3813
   108
native PbReadAngle(Handle:pb, const String:field[], Float:buffer[3], index=PB_FIELD_NOT_REPEATED);
skamonkey@3743
   109
skamonkey@3743
   110
/**
skamonkey@3743
   111
 * Reads an XYZ vector value from a protobuf message.
skamonkey@3743
   112
 *
skamonkey@3743
   113
 * @param pb			protobuf handle.
skamonkey@3743
   114
 * @param field			Field name.
skamonkey@3743
   115
 * @param buffer		Destination vector buffer.
skamonkey@3813
   116
 * @param index			Index into repeated field.
skamonkey@3743
   117
 * @noreturn
skamonkey@3743
   118
 * @error				Invalid or incorrect Handle, non-existant field, or incorrect field type.
skamonkey@3743
   119
 */
skamonkey@3813
   120
native PbReadVector(Handle:pb, const String:field[], Float:buffer[3], index=PB_FIELD_NOT_REPEATED);
skamonkey@3743
   121
skamonkey@3743
   122
/**
skamonkey@3743
   123
 * Reads an XY vector value from a protobuf message.
skamonkey@3743
   124
 *
skamonkey@3743
   125
 * @param pb			protobuf handle.
skamonkey@3743
   126
 * @param field			Field name.
skamonkey@3743
   127
 * @param buffer		Destination vector buffer.
skamonkey@3813
   128
 * @param index			Index into repeated field.
skamonkey@3743
   129
 * @noreturn
skamonkey@3743
   130
 * @error				Invalid or incorrect Handle, non-existant field, or incorrect field type.
skamonkey@3743
   131
 */
skamonkey@3813
   132
native PbReadVector2D(Handle:pb, const String:field[], Float:buffer[2], index=PB_FIELD_NOT_REPEATED);
skamonkey@3743
   133
skamonkey@3743
   134
/**
skamonkey@3743
   135
 * Gets the number of elements in a repeated field of a protobuf message.
skamonkey@3743
   136
 *
skamonkey@3743
   137
 * @param pb			protobuf handle.
skamonkey@3743
   138
 * @param field			Field name.
skamonkey@3743
   139
 * @return				Number of elements in the field.
skamonkey@3743
   140
 * @error				Invalid or incorrect Handle, non-existant field, or incorrect field type.
skamonkey@3743
   141
 */
skamonkey@3743
   142
native PbGetRepeatedFieldCount(Handle:pb, const String:field[]);
skamonkey@3743
   143
skamonkey@3743
   144
/**
skamonkey@3743
   145
 * Reads an int32, uint32, sint32, fixed32, or sfixed32 from a protobuf message repeated field.
skamonkey@3743
   146
 *
skamonkey@3743
   147
 * @param pb			protobuf handle.
skamonkey@3743
   148
 * @param field			Field name.
skamonkey@3743
   149
 * @param index			Index in the repeated field.
skamonkey@3743
   150
 * @return				Integer value read.
skamonkey@3743
   151
 * @error				Invalid or incorrect Handle, non-existant field, or incorrect field type.
skamonkey@3743
   152
 */
skamonkey@3813
   153
#pragma deprecated use PbReadInt with index param
skamonkey@3743
   154
native PbReadRepeatedInt(Handle:pb, const String:field[], index);
skamonkey@3743
   155
skamonkey@3743
   156
/**
skamonkey@3743
   157
 * Reads a float or downcasted double from a protobuf message repeated field.
skamonkey@3743
   158
 *
skamonkey@3743
   159
 * @param pb			protobuf handle.
skamonkey@3743
   160
 * @param field			Field name.
skamonkey@3743
   161
 * @param index			Index in the repeated field.
skamonkey@3743
   162
 * @return				Float value read.
skamonkey@3743
   163
 * @error				Invalid or incorrect Handle, non-existant field, or incorrect field type.
skamonkey@3743
   164
 */
skamonkey@3813
   165
#pragma deprecated use PbReadFloat with index param
skamonkey@3743
   166
native Float:PbReadRepeatedFloat(Handle:pb, const String:field[], index);
skamonkey@3743
   167
skamonkey@3743
   168
/**
skamonkey@3743
   169
 * Reads a bool from a protobuf message repeated field.
skamonkey@3743
   170
 *
skamonkey@3743
   171
 * @param pb			protobuf handle.
skamonkey@3743
   172
 * @param field			Field name.
skamonkey@3743
   173
 * @param index			Index in the repeated field.
skamonkey@3743
   174
 * @return				Boolean value read.
skamonkey@3743
   175
 * @error				Invalid or incorrect Handle, non-existant field, or incorrect field type.
skamonkey@3743
   176
 */
skamonkey@3813
   177
#pragma deprecated use PbReadBool with index param
skamonkey@3743
   178
native bool:PbReadRepeatedBool(Handle:pb, const String:field[], index);
skamonkey@3743
   179
skamonkey@3743
   180
/**
skamonkey@3743
   181
 * Reads a string from a protobuf message repeated field.
skamonkey@3743
   182
 *
skamonkey@3743
   183
 * @param pb			protobuf handle.
skamonkey@3743
   184
 * @param field			Field name.
skamonkey@3743
   185
 * @param index			Index in the repeated field.
skamonkey@3743
   186
 * @param buffer		Destination string buffer.
skamonkey@3743
   187
 * @param maxlength		Maximum length of output string buffer.
skamonkey@3743
   188
 * @noreturn
skamonkey@3743
   189
 * @error				Invalid or incorrect Handle, non-existant field, or incorrect field type.
skamonkey@3743
   190
 */
skamonkey@3813
   191
#pragma deprecated use PbReadString with index param
skamonkey@3743
   192
native PbReadRepeatedString(Handle:pb, const String:field[], index, String:buffer[], size);
skamonkey@3743
   193
skamonkey@3743
   194
/**
skamonkey@3743
   195
 * Reads an RGBA color value from a protobuf message repeated field.
skamonkey@3743
   196
 *
skamonkey@3743
   197
 * @param pb			protobuf handle.
skamonkey@3743
   198
 * @param field			Field name.
skamonkey@3743
   199
 * @param index			Index in the repeated field.
skamonkey@3743
   200
 * @param buffer		Destination color buffer.
skamonkey@3743
   201
 * @noreturn
skamonkey@3743
   202
 * @error				Invalid or incorrect Handle, non-existant field, or incorrect field type.
skamonkey@3743
   203
 */
skamonkey@3813
   204
#pragma deprecated use PbReadColor with index param
skamonkey@3743
   205
native PbReadRepeatedColor(Handle:pb, const String:field[], index, buffer[4]);
skamonkey@3743
   206
skamonkey@3743
   207
/**
skamonkey@3743
   208
 * Reads an XYZ angle value from a protobuf message repeated field.
skamonkey@3743
   209
 *
skamonkey@3743
   210
 * @param pb			protobuf handle.
skamonkey@3743
   211
 * @param field			Field name.
skamonkey@3743
   212
 * @param index			Index in the repeated field.
skamonkey@3743
   213
 * @param buffer		Destination angle buffer.
skamonkey@3743
   214
 * @noreturn
skamonkey@3743
   215
 * @error				Invalid or incorrect Handle, non-existant field, or incorrect field type.
skamonkey@3743
   216
 */
skamonkey@3813
   217
#pragma deprecated use PbReadAngle with index param
skamonkey@3743
   218
native PbReadRepeatedAngle(Handle:pb, const String:field[], index, Float:buffer[3]);
skamonkey@3743
   219
skamonkey@3743
   220
/**
skamonkey@3743
   221
 * Reads an XYZ vector value from a protobuf message repeated field.
skamonkey@3743
   222
 *
skamonkey@3743
   223
 * @param pb			protobuf handle.
skamonkey@3743
   224
 * @param field			Field name.
skamonkey@3743
   225
 * @param index			Index in the repeated field.
skamonkey@3743
   226
 * @param buffer		Destination vector buffer.
skamonkey@3743
   227
 * @noreturn
skamonkey@3743
   228
 * @error				Invalid or incorrect Handle, non-existant field, or incorrect field type.
skamonkey@3743
   229
 */
skamonkey@3813
   230
#pragma deprecated use PbReadVector with index param
skamonkey@3743
   231
native PbReadRepeatedVector(Handle:pb, const String:field[], index, Float:buffer[3]);
skamonkey@3743
   232
skamonkey@3743
   233
/**
skamonkey@3743
   234
 * Reads an XY vector value from a protobuf message repeated field.
skamonkey@3743
   235
 *
skamonkey@3743
   236
 * @param pb			protobuf handle.
skamonkey@3743
   237
 * @param field			Field name.
skamonkey@3743
   238
 * @param index			Index in the repeated field.
skamonkey@3743
   239
 * @param buffer		Destination vector buffer.
skamonkey@3743
   240
 * @noreturn
skamonkey@3743
   241
 * @error				Invalid or incorrect Handle, non-existant field, or incorrect field type.
skamonkey@3743
   242
 */
skamonkey@3813
   243
#pragma deprecated use PbReadVector2D with index param
skamonkey@3743
   244
native PbReadRepeatedVector2D(Handle:pb, const String:field[], index, Float:buffer[2]);
skamonkey@3743
   245
skamonkey@3743
   246
/**
skamonkey@3743
   247
 * Sets an int32, uint32, sint32, fixed32, or sfixed32  on a protobuf message.
skamonkey@3743
   248
 *
skamonkey@3743
   249
 * @param pb			protobuf handle.
skamonkey@3743
   250
 * @param field			Field name.
skamonkey@3743
   251
 * @param value			Integer value to set.
skamonkey@3814
   252
 * @param index			Index into repeated field.
skamonkey@3743
   253
 * @noreturn
skamonkey@3743
   254
 * @error				Invalid or incorrect Handle, non-existant field, or incorrect field type.
skamonkey@3743
   255
 */
skamonkey@3814
   256
native PbSetInt(Handle:pb, const String:field[], value, index=PB_FIELD_NOT_REPEATED);
skamonkey@3743
   257
skamonkey@3743
   258
/**
skamonkey@3743
   259
 * Sets a float or double on a protobuf message.
skamonkey@3743
   260
 *
skamonkey@3743
   261
 * @param pb			protobuf handle.
skamonkey@3743
   262
 * @param field			Field name.
skamonkey@3743
   263
 * @param value			Float value to set.
skamonkey@3814
   264
 * @param index			Index into repeated field.
skamonkey@3743
   265
 * @noreturn
skamonkey@3743
   266
 * @error				Invalid or incorrect Handle, non-existant field, or incorrect field type.
skamonkey@3743
   267
 */
skamonkey@3814
   268
native PbSetFloat(Handle:pb, const String:field[], Float:value, index=PB_FIELD_NOT_REPEATED);
skamonkey@3743
   269
skamonkey@3743
   270
/**
skamonkey@3743
   271
 * Sets a bool on a protobuf message.
skamonkey@3743
   272
 *
skamonkey@3743
   273
 * @param pb			protobuf handle.
skamonkey@3743
   274
 * @param field			Field name.
skamonkey@3743
   275
 * @param value			Boolean value to set.
skamonkey@3814
   276
 * @param index			Index into repeated field.
skamonkey@3743
   277
 * @noreturn
skamonkey@3743
   278
 * @error				Invalid or incorrect Handle, non-existant field, or incorrect field type.
skamonkey@3743
   279
 */
skamonkey@3814
   280
native PbSetBool(Handle:pb, const String:field[], bool:value, index=PB_FIELD_NOT_REPEATED);
skamonkey@3743
   281
skamonkey@3743
   282
/**
skamonkey@3743
   283
 * Sets a string on a protobuf message.
skamonkey@3743
   284
 *
skamonkey@3743
   285
 * @param pb			protobuf handle.
skamonkey@3743
   286
 * @param field			Field name.
skamonkey@3743
   287
 * @param value			String value to set.
skamonkey@3814
   288
 * @param index			Index into repeated field.
skamonkey@3743
   289
 * @noreturn
skamonkey@3743
   290
 * @error				Invalid or incorrect Handle, non-existant field, or incorrect field type.
skamonkey@3743
   291
 */
skamonkey@3814
   292
native PbSetString(Handle:pb, const String:field[], const String:value[], index=PB_FIELD_NOT_REPEATED);
skamonkey@3743
   293
skamonkey@3743
   294
/**
skamonkey@3743
   295
 * Sets an RGBA color on a protobuf message.
skamonkey@3743
   296
 *
skamonkey@3743
   297
 * @param pb			protobuf handle.
skamonkey@3743
   298
 * @param field			Field name.
skamonkey@3743
   299
 * @param value			Color value to set.
skamonkey@3814
   300
 * @param index			Index into repeated field.
skamonkey@3743
   301
 * @noreturn
skamonkey@3743
   302
 * @error				Invalid or incorrect Handle, non-existant field, or incorrect field type.
skamonkey@3743
   303
 */
skamonkey@3814
   304
native PbSetColor(Handle:pb, const String:field[], const color[4], index=PB_FIELD_NOT_REPEATED);
skamonkey@3743
   305
skamonkey@3743
   306
/**
skamonkey@3743
   307
 * Sets an XYZ angle on a protobuf message.
skamonkey@3743
   308
 *
skamonkey@3743
   309
 * @param pb			protobuf handle.
skamonkey@3743
   310
 * @param field			Field name.
skamonkey@3743
   311
 * @param value			Angle value to set.
skamonkey@3814
   312
 * @param index			Index into repeated field.
skamonkey@3743
   313
 * @noreturn
skamonkey@3743
   314
 * @error				Invalid or incorrect Handle, non-existant field, or incorrect field type.
skamonkey@3743
   315
 */
skamonkey@3814
   316
native PbSetAngle(Handle:pb, const String:field[], const Float:angle[3], index=PB_FIELD_NOT_REPEATED);
skamonkey@3743
   317
skamonkey@3743
   318
/**
skamonkey@3743
   319
 * Sets an XYZ vector on a protobuf message.
skamonkey@3743
   320
 *
skamonkey@3743
   321
 * @param pb			protobuf handle.
skamonkey@3743
   322
 * @param field			Field name.
skamonkey@3743
   323
 * @param value			Vector value to set.
skamonkey@3814
   324
 * @param index			Index into repeated field.
skamonkey@3743
   325
 * @noreturn
skamonkey@3743
   326
 * @error				Invalid or incorrect Handle, non-existant field, or incorrect field type.
skamonkey@3743
   327
 */
skamonkey@3814
   328
native PbSetVector(Handle:pb, const String:field[], const Float:vec[3], index=PB_FIELD_NOT_REPEATED);
skamonkey@3743
   329
skamonkey@3743
   330
/**
skamonkey@3743
   331
 * Sets an XY vector on a protobuf message.
skamonkey@3743
   332
 *
skamonkey@3743
   333
 * @param pb			protobuf handle.
skamonkey@3743
   334
 * @param field			Field name.
skamonkey@3743
   335
 * @param value			Vector value to set.
skamonkey@3814
   336
 * @param index			Index into repeated field.
skamonkey@3743
   337
 * @noreturn
skamonkey@3743
   338
 * @error				Invalid or incorrect Handle, non-existant field, or incorrect field type.
skamonkey@3743
   339
 */
skamonkey@3814
   340
native PbSetVector2D(Handle:pb, const String:field[], const Float:vec[2], index=PB_FIELD_NOT_REPEATED);
skamonkey@3743
   341
skamonkey@3743
   342
/**
skamonkey@3743
   343
 * Add an int32, uint32, sint32, fixed32, or sfixed32 to a protobuf message repeated field.
skamonkey@3743
   344
 *
skamonkey@3743
   345
 * @param pb			protobuf handle.
skamonkey@3743
   346
 * @param field			Field name.
skamonkey@3743
   347
 * @param value			Integer value to add.
skamonkey@3743
   348
 * @noreturn
skamonkey@3743
   349
 * @error				Invalid or incorrect Handle, non-existant field, or incorrect field type.
skamonkey@3743
   350
 */
skamonkey@3743
   351
native PbAddInt(Handle:pb, const String:field[], value);
skamonkey@3743
   352
skamonkey@3743
   353
/**
skamonkey@3743
   354
 * Add a float or double to a protobuf message repeated field.
skamonkey@3743
   355
 *
skamonkey@3743
   356
 * @param pb			protobuf handle.
skamonkey@3743
   357
 * @param field			Field name.
skamonkey@3743
   358
 * @param value			Float value to add.
skamonkey@3743
   359
 * @noreturn
skamonkey@3743
   360
 * @error				Invalid or incorrect Handle, non-existant field, or incorrect field type.
skamonkey@3743
   361
 */
skamonkey@3743
   362
native PbAddFloat(Handle:pb, const String:field[], Float:value);
skamonkey@3743
   363
skamonkey@3743
   364
/**
skamonkey@3743
   365
 * Add a bool to a protobuf message repeated field.
skamonkey@3743
   366
 *
skamonkey@3743
   367
 * @param pb			protobuf handle.
skamonkey@3743
   368
 * @param field			Field name.
skamonkey@3743
   369
 * @param value			Boolean value to add.
skamonkey@3743
   370
 * @noreturn
skamonkey@3743
   371
 * @error				Invalid or incorrect Handle, non-existant field, or incorrect field type.
skamonkey@3743
   372
 */
skamonkey@3743
   373
native PbAddBool(Handle:pb, const String:field[], bool:value);
skamonkey@3743
   374
skamonkey@3743
   375
/**
skamonkey@3743
   376
 * Add a string to a protobuf message repeated field.
skamonkey@3743
   377
 *
skamonkey@3743
   378
 * @param pb			protobuf handle.
skamonkey@3743
   379
 * @param field			Field name.
skamonkey@3743
   380
 * @param value			String value to add.
skamonkey@3743
   381
 * @noreturn
skamonkey@3743
   382
 * @error				Invalid or incorrect Handle, non-existant field, or incorrect field type.
skamonkey@3743
   383
 */
skamonkey@3743
   384
native PbAddString(Handle:pb, const String:field[], const String:value[]);
skamonkey@3743
   385
skamonkey@3743
   386
/**
skamonkey@3743
   387
 * Add an RGBA color to a protobuf message repeated field.
skamonkey@3743
   388
 *
skamonkey@3743
   389
 * @param pb			protobuf handle.
skamonkey@3743
   390
 * @param field			Field name.
skamonkey@3743
   391
 * @param value			Color value to add.
skamonkey@3743
   392
 * @noreturn
skamonkey@3743
   393
 * @error				Invalid or incorrect Handle, non-existant field, or incorrect field type.
skamonkey@3743
   394
 */
skamonkey@3743
   395
native PbAddColor(Handle:pb, const String:field[], const color[4]);
skamonkey@3743
   396
skamonkey@3743
   397
/**
skamonkey@3743
   398
 * Add an XYZ angle to a protobuf message repeated field.
skamonkey@3743
   399
 *
skamonkey@3743
   400
 * @param pb			protobuf handle.
skamonkey@3743
   401
 * @param field			Field name.
skamonkey@3743
   402
 * @param value			Angle value to add.
skamonkey@3743
   403
 * @noreturn
skamonkey@3743
   404
 * @error				Invalid or incorrect Handle, non-existant field, or incorrect field type.
skamonkey@3743
   405
 */
skamonkey@3743
   406
native PbAddAngle(Handle:pb, const String:field[], const Float:angle[3]);
skamonkey@3743
   407
skamonkey@3743
   408
/**
skamonkey@3743
   409
 * Add an XYZ vector to a protobuf message repeated field.
skamonkey@3743
   410
 *
skamonkey@3743
   411
 * @param pb			protobuf handle.
skamonkey@3743
   412
 * @param field			Field name.
skamonkey@3743
   413
 * @param value			Vector value to add.
skamonkey@3743
   414
 * @noreturn
skamonkey@3743
   415
 * @error				Invalid or incorrect Handle, non-existant field, or incorrect field type.
skamonkey@3743
   416
 */
skamonkey@3743
   417
native PbAddVector(Handle:pb, const String:field[], const Float:vec[3]);
skamonkey@3743
   418
skamonkey@3743
   419
/**
skamonkey@3743
   420
 * Add an XY vector to a protobuf message repeated field.
skamonkey@3743
   421
 *
skamonkey@3743
   422
 * @param pb			protobuf handle.
skamonkey@3743
   423
 * @param field			Field name.
skamonkey@3743
   424
 * @param value			Vector value to add.
skamonkey@3743
   425
 * @noreturn
skamonkey@3743
   426
 * @error				Invalid or incorrect Handle, non-existant field, or incorrect field type.
skamonkey@3743
   427
 */
skamonkey@3743
   428
native PbAddVector2D(Handle:pb, const String:field[], const Float:vec[2]);
skamonkey@3743
   429
skamonkey@3743
   430
/**
skamonkey@3743
   431
 * Retrieve a handle to an embedded protobuf message in a protobuf message.
skamonkey@3743
   432
 *
skamonkey@3743
   433
 * @param pb			protobuf handle.
skamonkey@3743
   434
 * @param field			Field name.
skamonkey@3743
   435
 * @return				protobuf handle to embedded message.
skamonkey@3743
   436
 * @error				Invalid or incorrect Handle, non-existant field, or incorrect field type.
skamonkey@3743
   437
 */ 
skamonkey@3743
   438
native Handle:PbReadMessage(Handle:pb, const String:field[]);
skamonkey@3743
   439
skamonkey@3743
   440
/**
skamonkey@3743
   441
 * Retrieve a handle to an embedded protobuf message in a protobuf message repeated field.
skamonkey@3743
   442
 *
skamonkey@3743
   443
 * @param pb			protobuf handle.
skamonkey@3743
   444
 * @param field			Field name.
skamonkey@3743
   445
 * @param index			Index in the repeated field.
skamonkey@3743
   446
 * @return				protobuf handle to embedded message.
skamonkey@3743
   447
 * @error				Invalid or incorrect Handle, non-existant field, or incorrect field type.
skamonkey@3743
   448
 */ 
skamonkey@3743
   449
native Handle:PbReadRepeatedMessage(Handle:pb, const String:field[], index);
skamonkey@3743
   450
skamonkey@3743
   451
/**
skamonkey@3743
   452
 * Adds an embedded protobuf message to a protobuf message repeated field.
skamonkey@3743
   453
 *
skamonkey@3743
   454
 * @param pb			protobuf handle.
skamonkey@3743
   455
 * @param field			Field name.
skamonkey@3743
   456
 * @return				protobuf handle to added, embedded message.
skamonkey@3743
   457
 * @error				Invalid or incorrect Handle, non-existant field, or incorrect field type.
skamonkey@3743
   458
 */ 
skamonkey@3743
   459
native Handle:PbAddMessage(Handle:pb, const String:field[]);