cvstr.c File Reference

#include "stack-c.h"
#include "core_math.h"
#include "machine.h"

Include dependency graph for cvstr.c:

Go to the source code of this file.

Defines

#define TRUE_   1
#define FALSE_   0

Functions

integer C2F() getfastcode (unsigned char *c, unsigned long c_len)
int C2F() cvstr (integer *n, integer *line, char *str, integer *job, unsigned long str_len)
int C2F() cvstr1 (integer *n, integer *line, char *str, integer *job, unsigned long str_len)
int C2F() codetoascii (integer *n, integer *line, char *str, unsigned long str_len)
int C2F() asciitocode (integer *n, integer *line, char *str, integer *flagx, unsigned long str_len)
integer C2F() getcode (unsigned char *mc, unsigned long mc_len)

Variables

static integer cx1 = 1
static integer c_n1 = -1
static integer taba2s [128]


Define Documentation

#define FALSE_   0

Definition at line 4 of file cvstr.c.

#define TRUE_   1

Definition at line 3 of file cvstr.c.


Function Documentation

int C2F() asciitocode ( integer n,
integer line,
char *  str,
integer flagx,
unsigned long  str_len 
)

Definition at line 95 of file cvstr.c.

References C2F, flagx, getfastcode(), j, L, line, n, and str.

Referenced by cvstr(), and cvstr1().

00096 {
00097   integer j;
00098   if (*flagx == 1) {
00099     for (j = 0; j < *n ; ++j) {
00100       line[j] = C2F(getfastcode)(str+j, 1L);
00101     }
00102   } else {
00103     for (j = *n -1 ; j >= 0; --j) {
00104       line[j] = C2F(getfastcode)(str+j, 1L);
00105     }
00106   }
00107   return 0;
00108 } 

Here is the call graph for this function:

Here is the caller graph for this function:

int C2F() codetoascii ( integer n,
integer line,
char *  str,
unsigned long  str_len 
)

Definition at line 55 of file cvstr.c.

References Abs, alfb, C2F, csiz, eol, j, line, m, n, and str.

Referenced by cvstr(), cvstr1(), and in2str().

00057 {
00058   static integer eol = 99;
00059   int j, m;
00060   /*     conversion code ->ascii */
00061   for (j = 0; j < *n; ++j) {
00062     m = line[j];
00063     if (m == eol) 
00064       {
00065         str[j] = '!';
00066       } 
00067     else if (Abs(m) > csiz) 
00068       {
00069         if (m > eol) {
00070           str[j] = (char)(m - (eol + 1));
00071         } else {
00072           str[j] = '!';
00073         }
00074       } 
00075     else if (m < 0) 
00076       {
00077         str[j] = C2F(cha1).alfb[Abs(m)];
00078       } 
00079     else
00080       {
00081         str[j] = C2F(cha1).alfa[m];
00082       }
00083   }
00084   return 0;
00085 } 

Here is the caller graph for this function:

int C2F() cvstr ( integer n,
integer line,
char *  str,
integer job,
unsigned long  str_len 
)

Definition at line 25 of file cvstr.c.

References asciitocode(), C2F, codetoascii(), cx1, job, line, n, str, and str_len.

Referenced by __PARAMS(), bufstore(), C2F(), ccharf(), cre_smat_from_str_i(), creadchain(), creadchains(), cresmat3(), CreSmatFromHist(), cresmatvar(), cstringf(), cwritechain(), getblockbylabel(), getexternal(), getlabel(), getpoly(), intcpass2(), intgetscicosvarsc(), intscicosimc(), MlistGetFieldNumber(), mxCreateCharMatrixFromStrings(), mxcreatestring(), mxGetFieldNameByNumber(), mxGetFieldNumber(), readc(), scicos(), ScilabC2MStr2(), ScilabCM2MStr(), ScilabMStr2C(), ScilabStr2C(), str2sci(), and sttyp().

00027 {
00028   if (*job == 0) 
00029     C2F(asciitocode)(n, line, str, &cx1, str_len);
00030   else 
00031     C2F(codetoascii)(n, line, str, str_len);
00032   return 0;
00033 } 

Here is the call graph for this function:

Here is the caller graph for this function:

int C2F() cvstr1 ( integer n,
integer line,
char *  str,
integer job,
unsigned long  str_len 
)

Definition at line 40 of file cvstr.c.

References asciitocode(), C2F, c_n1, codetoascii(), job, line, n, str, and str_len.

Referenced by ConvertData(), createlistvarfrom(), and createvarfrom().

00042 {
00043   if (*job == 0) 
00044     C2F(asciitocode)(n, line, str, &c_n1, str_len);
00045   else 
00046     C2F(codetoascii)(n, line, str, str_len);
00047   return 0;
00048 } 

Here is the call graph for this function:

Here is the caller graph for this function:

integer C2F() getcode ( unsigned char *  mc,
unsigned long  mc_len 
)

Definition at line 116 of file cvstr.c.

References alfa, alfb, C2F, csiz, and eol.

00117 {
00118   static integer eol = 99;
00119   integer k;
00120   for (k = 0 ; k < csiz; ++k) {
00121     if ( *mc == C2F(cha1).alfa[k]) 
00122       {
00123         return k ;
00124       }
00125     else if ( *mc == C2F(cha1).alfb[k]) {
00126       return - k;
00127     }
00128   }
00129   /*     special characters */
00130   switch ( *mc ) {
00131   case 0:  return  100; break; 
00132   case 9:  return 109; break; 
00133   case 10: return 110 ; break; 
00134   default : 
00135     return  *mc + eol + 1;
00136   }
00137 } 

integer C2F() getfastcode ( unsigned char *  c,
unsigned long  c_len 
)

Referenced by asciitocode(), and equal_scistring_and_string().

Here is the caller graph for this function:


Variable Documentation

integer c_n1 = -1 [static]

Definition at line 9 of file cvstr.c.

Referenced by bouncexy(), cmscope(), cscope(), cvstr1(), insmat(), parse(), and TCL_EvalScilabCmd().

integer cx1 = 1 [static]

Definition at line 8 of file cvstr.c.

Referenced by bufstore(), copyobj(), copysmat(), creadchain(), creadchains(), createcvarfrom(), createlistcvarfrom(), createlistvarfrom(), createvarfrom(), cresmati(), cvstr(), cwritebmat(), cwritecmat(), cwritemat(), Get_Iname(), getexternal(), getlengthchain(), getlistrhsvar(), getpoly(), getrhsvar(), intbdiagr(), isoptlw(), lmatj(), mvfromto(), pmatj(), sci_glue(), scibuiltin(), scifunction(), scirun(), smatj(), and vcopyobj().

integer taba2s[128] [static]

Initial value:

 
{ 100,101,102,103,104,105,106,107,108,-40,
  110,111,112,113,114,115,116,117,118,119,
 120,121,122,123,124,125,126,127,128,129,
 130,131, 40, 38,-53, 37, 39, 56, 58, 53,
  41, 42, 47, 45, 52, 46, 51, 48,  0,  1,
   2,  3,  4,  5,  6,  7,  8,  9, 44, 43,
  59, 50, 60,-38,-61,-10,-11,-12,-13,-14,
 -15,-16,-17,-18,-19,-20,-21,-22,-23,-24,
 -25,-26,-27,-28,-29,-30,-31,-32,-33,-34,
 -35, 54, 49, 55, 62, 36,-59, 10, 11, 12,
  13, 14, 15, 16, 17, 18, 19, 20, 21, 22,
  23, 24, 25, 26, 27, 28, 29, 30, 31, 32,
  33, 34, 35,-54, 57,-55, 61,227 }

Definition at line 142 of file cvstr.c.


Generated on Sun Mar 4 15:14:46 2007 for Scilab [trunk] by  doxygen 1.5.1