Ignore:
Timestamp:
Jul 26, 2009, 9:17:28 PM (11 years ago)
Author:
Sam Hocevar
Message:

Coding style: remove tabs and trailing spaces.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libcaca/trunk/python/pypycaca.c

    r1462 r3582  
    6060    {"printf", pycaca_printf, METH_VARARGS, ""},
    6161    {"clear", pycaca_clear, METH_VARARGS, ""},
    62    
     62
    6363    {"load_sprite", pycaca_load_sprite, METH_VARARGS, ""},
    6464    {"draw_sprite", pycaca_draw_sprite,  METH_VARARGS, ""},
     
    8080    {"draw_bitmap", pycaca_draw_bitmap, METH_VARARGS, ""},
    8181    {"free_bitmap", pycaca_free_bitmap, METH_VARARGS, ""},
    82    
     82
    8383
    8484
     
    9999  obj = Py_InitModule("caca", CacaMethods);
    100100  dict = PyModule_GetDict(obj);
    101    
     101
    102102  SET_INTCONSTANT(dict,CACA_EVENT_NONE );
    103103  SET_INTCONSTANT(dict,CACA_EVENT_KEY_PRESS );
     
    108108  SET_INTCONSTANT(dict,CACA_EVENT_RESIZE );
    109109  SET_INTCONSTANT(dict,CACA_EVENT_ANY );
    110  
     110
    111111  SET_INTCONSTANT(dict, CACA_COLOR_BLACK );
    112112  SET_INTCONSTANT(dict, CACA_COLOR_BLUE );
     
    192192{
    193193  int ret;
    194  
     194
    195195  ret = caca_init();
    196196  return Py_BuildValue("i", ret);
     
    301301  if (!PyArg_ParseTuple(args, "i", &value));
    302302  ret = caca_get_feature(value);
    303  
     303
    304304  return Py_BuildValue("i", ret);
    305305
     
    312312  if (!PyArg_ParseTuple(args, "i", &value));
    313313  caca_set_feature(value);
    314  
     314
    315315  return Py_BuildValue("i", 1); /* FIXME */
    316316
     
    324324
    325325  ret = (char* const)caca_get_feature_name(value);
    326  
     326
    327327  return Py_BuildValue("s", ret);
    328328}
     
    338338
    339339  ret = caca_get_event(value);
    340  
     340
    341341  return Py_BuildValue("i", ret);
    342342}
     
    348348
    349349  ret = caca_get_event(value);
    350  
     350
    351351  return Py_BuildValue("i", ret);
    352352}
     
    374374  int x1, y1, x2, y2;
    375375  char c;
    376  
     376
    377377  if (!PyArg_ParseTuple(args, "iiiic", &x1,&y1,&x2,&y2,&c));
    378378  caca_draw_line(x1,y1,x2,y2,c);
     
    385385  int *x, *y, n, lenx, leny, i;
    386386  char c;
    387  
     387
    388388  if (!PyArg_ParseTuple(args, "OOic", &list_x, &list_y, &n, &c));
    389389
    390390  lenx = PySequence_Length(list_x);
    391391  leny = PySequence_Length(list_y);
    392  
     392
    393393  x = (int*) malloc(lenx*sizeof(int));
    394394  y = (int*) malloc(leny*sizeof(int));
     
    419419{
    420420  int x1, y1, x2, y2;
    421  
     421
    422422  if (!PyArg_ParseTuple(args, "iiii", &x1,&y1,&x2,&y2));
    423423  caca_draw_thin_line(x1,y1,x2,y2);
     
    430430  PyObject *list_x, *list_y, *item;
    431431  int *x, *y, n, lenx, leny, i;
    432  
     432
    433433  if (!PyArg_ParseTuple(args, "OOi", &list_x, &list_y, &n));
    434434
    435435  lenx = PySequence_Length(list_x);
    436436  leny = PySequence_Length(list_y);
    437  
     437
    438438  x = (int*) malloc(lenx*sizeof(int));
    439439  y = (int*) malloc(leny*sizeof(int));
     
    565565{
    566566  int ret = caca_get_fg_color();
    567   return Py_BuildValue("i", ret); 
     567  return Py_BuildValue("i", ret);
    568568}
    569569
     
    572572{
    573573  int ret = caca_get_bg_color();
    574   return Py_BuildValue("i", ret); 
     574  return Py_BuildValue("i", ret);
    575575}
    576576
     
    582582  if (!PyArg_ParseTuple(args, "i", &c));
    583583  ret = (char *)caca_get_color_name(c);
    584  
     584
    585585  return Py_BuildValue("s", ret); /* FIXME */
    586586}
     
    649649  if (!PyArg_ParseTuple(args, "iiii", &x, &y, &sprite,&frame));
    650650  caca_draw_sprite(x,y, (struct caca_sprite const *)PyCObject_AsVoidPtr((void*)sprite), frame);
    651  
     651
    652652  return Py_BuildValue("i", 1); /* FIXME */
    653653}
     
    660660  ret = caca_get_sprite_frames((struct caca_sprite const *)PyCObject_AsVoidPtr((void*)sprite));
    661661
    662   return Py_BuildValue("i", ret); 
    663  
     662  return Py_BuildValue("i", ret);
     663
    664664}
    665665
     
    671671  ret = caca_get_sprite_width((struct caca_sprite const *)PyCObject_AsVoidPtr((void*)sprite),i);
    672672
    673   return Py_BuildValue("i", ret); 
     673  return Py_BuildValue("i", ret);
    674674
    675675}
     
    681681  if (!PyArg_ParseTuple(args, "ii", &sprite, i));
    682682  ret = caca_get_sprite_height((struct caca_sprite const *)PyCObject_AsVoidPtr((void*)sprite),i);
    683  
    684   return Py_BuildValue("i", ret); 
     683
     684  return Py_BuildValue("i", ret);
    685685}
    686686
     
    691691  if (!PyArg_ParseTuple(args, "ii", &sprite), &i);
    692692  ret = caca_get_sprite_dx((struct caca_sprite const *)PyCObject_AsVoidPtr((void*)sprite),i);
    693  
    694   return Py_BuildValue("i", ret); 
     693
     694  return Py_BuildValue("i", ret);
    695695}
    696696
     
    701701  if (!PyArg_ParseTuple(args, "ii", &sprite), &i);
    702702  ret = caca_get_sprite_dy((struct caca_sprite const *)PyCObject_AsVoidPtr((void*)sprite),i);
    703  
    704   return Py_BuildValue("i", ret); 
     703
     704  return Py_BuildValue("i", ret);
    705705}
    706706
     
    711711  if (!PyArg_ParseTuple(args, "i", &sprite));
    712712  caca_free_sprite((struct caca_sprite *)PyCObject_AsVoidPtr((void*)sprite));
    713  
     713
    714714  return Py_BuildValue("i", 1);  /* FIXME */
    715715}
     
    723723  if (!PyArg_ParseTuple(args, ""));
    724724
    725   return Py_BuildValue("s",caca_get_html()); 
     725  return Py_BuildValue("s",caca_get_html());
    726726}
    727727
     
    731731  if (!PyArg_ParseTuple(args, ""));
    732732
    733   return Py_BuildValue("s",caca_get_html3()); 
     733  return Py_BuildValue("s",caca_get_html3());
    734734}
    735735
     
    739739  if (!PyArg_ParseTuple(args, ""));
    740740
    741   return Py_BuildValue("s",caca_get_irc()); 
     741  return Py_BuildValue("s",caca_get_irc());
    742742}
    743743
     
    747747  int trailing;
    748748  if (!PyArg_ParseTuple(args, "i", &trailing));
    749  
    750   return Py_BuildValue("s",caca_get_ansi(trailing)); 
     749
     750  return Py_BuildValue("s",caca_get_ansi(trailing));
    751751}
    752752
     
    774774
    775775  if (!PyArg_ParseTuple(args, "iOOOO", &bitmap, &list_r, &list_g, &list_b, &list_a));
    776  
     776
    777777  if((PySequence_Length(list_r)!=256) ||
    778778     (PySequence_Length(list_g)!=256) ||
     
    782782      PyErr_SetString(PyExc_TypeError, "Lengths of colors lists must be 256");
    783783    }
    784      
     784
    785785  r = malloc(256*sizeof(unsigned int));
    786786  g = malloc(256*sizeof(unsigned int));
     
    827827
    828828  if (!PyArg_ParseTuple(args, "iiiiiO", &x1,&y1,&x2,&y2,&bitmap,&pixels));
    829  
     829
    830830
    831831  buffer = malloc(PySequence_Length(pixels)*sizeof(unsigned char));
    832832
    833  
     833
    834834  for(i=0;i<PySequence_Length(pixels);i++)
    835835    {
     
    837837      buffer[i] = (unsigned char)PyInt_AsLong(item);
    838838    }
    839  
     839
    840840
    841841
Note: See TracChangeset for help on using the changeset viewer.