Exemplo n.º 1
0
my_bool Json_Object_init(UDF_INIT *initid, UDF_ARGS *args, char *message)
{
  unsigned long reslen, memlen;

  CalcLen(args, true, reslen, memlen);
  return JsonInit(initid, message, reslen, memlen);
} // end of Json_Object_init
Exemplo n.º 2
0
void NoteTrack::SetSequence(Seq *seq)
{
   if (mSeq)
      delete mSeq;

   mSeq = seq;

   CalcLen();
}
VOID
ISAPI_STRING::Unescape(
    VOID
    )
/*++

Purpose:

    Decodes escape sequences in the ISAPI_STRING's data

Arguments:

    None

Returns:

    None

--*/
{
    CHAR *  pRead;
    CHAR *  pWrite;
    CHAR    szHex[3] = {0};
    BYTE    c;

    pRead = (CHAR*)_Buffer.QueryPtr();
    pWrite = pRead;

    while ( *pRead )
    {
        if ( IsEscapeSequence( pRead ) )
        {
            szHex[0] = *(pRead+1);
            szHex[1] = *(pRead+2);

            c = (BYTE)strtoul( szHex, NULL, 16 );

            *pWrite = c;

            pRead += 3;
            pWrite++;

            continue;
        }

        *pWrite = *pRead;

        pRead++;
        pWrite++;
    }

    *pWrite = '\0';

    CalcLen();

    return;
}
Exemplo n.º 4
0
my_bool Json_Value_init(UDF_INIT *initid, UDF_ARGS *args, char *message)
{
  unsigned long reslen, memlen;

  if (args->arg_count > 1) {
    strcpy(message, "Json_Value cannot accept more than 1 argument");
    return true;
  } else
    CalcLen(args, false, reslen, memlen);

  return JsonInit(initid, message, reslen, memlen);
} // end of Json_Value_init
Exemplo n.º 5
0
my_bool Json_Array_Delete_init(UDF_INIT *initid, UDF_ARGS *args, char *message)
{
  unsigned long reslen, memlen;

  if (args->arg_count != 2) {
    strcpy(message, "Json_Value_Delete must have 2 arguments");
    return true;
  } else if (!IsJson(args, 0)) {
    strcpy(message, "Json_Value_Delete first argument must be a json item");
    return true;
  } else
    CalcLen(args, false, reslen, memlen);

  return JsonInit(initid, message, reslen, memlen);
} // end of Json_Array_Delete_init
Exemplo n.º 6
0
my_bool Json_Object_Grp_init(UDF_INIT *initid, UDF_ARGS *args, char *message)
{
  unsigned long reslen, memlen, n = GetJsonGrpSize();

  if (args->arg_count != 2) {
    strcpy(message, "Json_Array_Grp can only accept 2 arguments");
    return true;
  } else 
    CalcLen(args, true, reslen, memlen);
  
  reslen *= n;
  memlen += ((memlen - MEMFIX) * (n - 1));

  if (JsonInit(initid, message, reslen, memlen))
    return true;

  PGLOBAL g = (PGLOBAL)initid->ptr;

  PlugSubSet(g, g->Sarea, g->Sarea_Size);
  g->Activityp = (PACTIVITY)new(g) JOBJECT;
  g->N = (int)n;
  return false;
} // end of Json_Object_Grp_init
Exemplo n.º 7
0
char *PrintCS( char *pszTxt )
{
    g_dwTextPrnX = g_dwTextCutLf + ( ( g_dwTextCutRt - g_dwTextCutLf  - CalcLen( pszTxt ) ) / 2 );
    return PrintS( pszTxt );

}