Bienvenido a Tecnohackers

Tecnohackers » Programacion » Area de Programacion » Programacion a Bajo Nivel. APIs, Hooking, ASM, C/C++, etc.
 » 

Marquesina[Linux]



Autor Tema: Marquesina[Linux]  (Leído 1240 veces)

Desconectado P4|3L0

  • Asiduo
  • *
  • Mensajes: 75
  • TecnoHacker un nuevo proyecto.
    • http://www.tecnohacker.com
Marquesina[Linux]
« en: Diciembre 29, 2009, 05:08:04 pm »
Un metodo tan viejo como la rabia, pero que me ha ayudado con muchas cosas.

Lo pongo por si os sirve.

Código: You are not allowed to view links. Register or Login
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <stdbool.h>

int mystrlen(char *s)
{
    int i = 0;
    while (*s++)
        ++i;
    return i;
}

char msg[] = "Mensaje en modo marquesina, metodo marquesina for Linux;)";

int main(int argc, char**argv)
{
    int i;
    int len = mystrlen(msg);
    int start = len - 40;
    int istart = start;

    system("clear");

    while (true)
    {
        --istart;
        for (i = 0; i < 40; ++i)
        {
            if ((istart + i) >= len)
            {
                fputc(msg[(istart + i) - len], stdout);
            }
            else
            {
                fputc(msg[istart + i], stdout);
            }
        }
        if (istart == 0) istart = len;
        fflush(NULL);
        sleep(1);
        system("clear");
    }
    exit(EXIT_SUCCESS);
}

//gcc marquesina.c -o marquesina.out




Tags:
Tags:

 


SMF 2.0.19 | SMF © 2016, Simple Machines
Paginas Afiliadas
Twitter - FaceBook - Daraxblog
Designed by Smf Personal